home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d889.lha / Csh / csh.doc < prev    next >
Text File  |  1993-07-16  |  97KB  |  2,814 lines

  1.  
  2.         INSTRUCTIONS FOR C-SHELL VERSION: 5.31   June 1993
  3.         ==================================================
  4.  
  5.   Contents
  6.   --------
  7.  
  8.     O.    Installation
  9.     I.    Description
  10.     II.    Overview of major features
  11.     III.    Restrictions
  12.     IV.    PIPES
  13.     V.    Command Pre-processor
  14.     VI.    Command Line Editing
  15.     VII.    Function Keys
  16.     VIII.    Shell Commands
  17.     IX.    Special Set Variables
  18.     X.    Functions
  19.     XI.    Miscellaneous
  20.     XII.    Example source files
  21.     XIII.    Default values
  22.     XIV.    Object oriented features
  23.     XV.    Keymaps
  24.  
  25.  
  26.  
  27. O.  Installation
  28. ----------------
  29.  
  30. This program requires at least AmigaOS 2.04 (KS37.175, WB37.67) or higher.
  31.  
  32. For  online  help  inside csh, assign CSH:  somewhere and put csh.doc there.
  33. Then  you can use the 'man' command for any desired command.  Press the HELP
  34. key for a command list.
  35.  
  36. You  can  simply  invoke  csh  from  the  command line or at the end of your
  37. startup-sequence,  because  csh is, from the AmigaDOS standpoint, not a true
  38. shell  like  l:shell-seg.   Nevertheless, csh is 'pure', so if your archiver
  39. forgot to set the 'p' bit, do it right now.
  40.  
  41. Proposed final setup:  If you want to make csh resident, do the following:
  42.  
  43.   1. Copy csh anywhere on your (hard)disk, e.g. dh1:tools
  44.   2. Make sure your s:startup-sequence contains:
  45.     resident dh1:tools/csh add
  46.     csh
  47.   4. In s:.login, put any commands to be called only once, like setmap,
  48.     assign, setclock. This is a shell script, use # for comments, and
  49.     don't use .key type commands.
  50.   5. In s:.cshrc, you put any commands that need to be executed on every
  51.     invocation, like 'alias', 'set' and so on.
  52.   6. Put the following to s:cli-startup and s:shell-startup, so csh will be
  53.     started in any window opened by NewCLI, NewShell or from workbench:
  54.         csh
  55.         endcli
  56.  
  57.  
  58. Additionally,  I  recommend  to assign CSH:  somewhere and put your docs and
  59. CShell scripts there.  You can do the assign from inside the shell, it's not
  60. needed at startup.
  61.  
  62. The file s:.cshrc is executed on every startup (of csh) if it exists,
  63. the file s:.login only on csh's first invocation after boottime.
  64.  
  65.  
  66. I.  DESCRIPTION
  67. ---------------
  68.  
  69. This version of Shell is the successor of:
  70.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  71.     Shell V2.04M-V2.07M by Steve Drew
  72.     Shell V2.08MI, V3.xxA and V4.xxA by Carlo Borreo & Cesare Dieni
  73.     Shell V5.xxL by U. Dominik Mueller
  74.     Shell V5.20+ by Andreas M. Kirchwitz
  75.  
  76.  
  77.  
  78. Responsible for the V5.20+ series of Cshell is:
  79.  
  80.      Andreas M. Kirchwitz
  81.      Seesener Str. 69, D-10709 Berlin, Germany
  82.      UUCP/InterNet: csh-fan@zikzak.in-berlin.de
  83.  
  84. Send wishes, bug reports (and the beer bottles :) to the above address.
  85. The V5.20+ series is an ARP-free, OS-2.x-only pre-6.0 version of Cshell.
  86. It only has an english ascii-doc, but it sweetens the time until Csh 6.x
  87. (by Urban Mueller) is available ;-)
  88.  
  89.  
  90.  
  91. If you have any wishes, bug reports or beer bottles, send them to:
  92.  
  93.        FIDONET :  Urban Mueller@2:302/906 (AUGL)
  94.        INTERNET:  umueller@iiic.ethz.ch
  95.                   umueller@amiga.physik.unizh.ch
  96. or
  97.        U. Dominik Mueller
  98.        Schulhausstrasse 83
  99.     CH-6312 Steinhausen
  100.        SWITZERLAND
  101.  
  102. Any sign of intelligent life welcome! German, English and French spoken.
  103.  
  104. Please check the 'restrictions' chapter before reporting any bugs and add
  105. your CShell version and a description of your configuration.
  106.  
  107. You may distribute this program unmodified and for non-profit only.
  108.    *** YOU MAY NOT MODIFY THIS PROGRAM AND REDISTRIBUTE IT ***
  109. Please contact me if you want to make changes.
  110.  
  111.  
  112. AVAILABILITY
  113. ------------
  114.  
  115. CShell can always be downloaded at the AUGL BBS.  Some additionals parts
  116. (French documentation) are available there, too.
  117.  
  118. For those who want to get it per FIDO file request, the archive is always
  119. named like 'csh513.lzh' for CShell 5.13 and 'csh513s.lzh' for its source.
  120.  
  121. CShell is available via FTP from AmiNet (and mirrors) in the directory
  122. /pub/amiga/shell/ (the archive names are the same) and via UUCP/Internet-
  123. EMail from "mail-server@cs.tu-berlin.de" in the same directory.
  124.  
  125.  
  126. CREDITS
  127. -------
  128.  
  129. Arexx is a program by William Hawes.
  130. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  131.  
  132. Thanks to:
  133.  
  134. Matt Dillon, Steve Drew, Calro Borreo and Cesare Dieni for the previous
  135. versions of Csh.
  136.  
  137. Eddy Carroll, Gary Duncan, Randell Jesup, Steve Koren, Tim MacKenzie, Axel
  138. Roebel, Mike Schwartz for their code contributions and suggestions.
  139.  
  140. Michael Beer, Carl Johan Block, Hubert Feyere, Magnus Heldestad, Carsten
  141. Heyl, Alex Liu, Declan McArdle, Svante Eriksson, Luke Mewburn, Peter Orbaek,
  142. Allard Siemelink, Roddi Walker, Shimon Weissman and the unknown Swedish guy
  143. who found the double-LF bug for their bug reports and feedback.
  144.  
  145. Roy Haverman, Martin Horneffer, Hans-Christian Huerlimann, Daniel Pfulg,
  146. Patrizio Rusconi, Christian Schneider and especially Markus Illenseer for
  147. the German translation of the doc.
  148.  
  149. Olivier Berger for the French translation of the doc.
  150.  
  151.  
  152. AMIGAGUIDE
  153. ----------
  154.  
  155.   AmigaGuide, AmigaGuide.info, amigaguide.library, WDisplay, WDisplay.info
  156.        (c) Copyright 1992 Commodore-Amiga, Inc.  All Rights Reserved.
  157.           Reproduced and distributed under license from Commodore.
  158.  
  159.        AMIGAGUIDE SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  160.      NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  161.                         OR RESPONSIBILITY IS ASSUMED.
  162.  
  163.  
  164. II. OVERVIEW
  165. ------------
  166.  
  167. Shell provides a convenient AmigaDos alternative command interface.  All its
  168. commands  are internal and thus it does not rely on the c:  commands for any
  169. functionality.
  170.  
  171. Major features include:
  172.     - freely programmable command line editing
  173.     - simple history
  174.     - piping
  175.     - aliases with arguments
  176.     - variables & variable handling (embedded variables)
  177.     - file name expansion via wild carding ('?', '*' and more)
  178.     - conditionals (if/else etc..)
  179.     - source files  (w/ gotos and labels)
  180.     - tab file name completion
  181.     - object oriented features (file classes, actions)
  182.     - many built in commands to speed things up
  183.     - full functionality on VT terminals
  184.  
  185. CShell runs on minimum stack, for recursive aliases and source files better
  186. increase stack to 10K or more.
  187.  
  188. If you use CShell for the first time, remember the following:
  189.     - CShell internal commands must be lowercase & can be abbreviated
  190.     - AmigaDOS command 'Execute' causes some trouble. You cannot
  191.       redirect it, you must not rename it, and you get no return code.
  192.       You can also use 'source' to start your scripts, but you'll have
  193.       to rewrite them a bit. Besides the '.key'-type commands, 'source'
  194.       is downward compatible with 'Execute'.
  195.     - You can always get more information on a command if csh.doc is
  196.       in the current directory or in csh: (you will be able to modify
  197.       this) and you enter 'man <command>'
  198.     - The wild card #? doesn't work. Use *
  199.        (#? only works if you "escape" it... better use * :-)
  200.  
  201.  
  202. III. RESTRICTIONS
  203. -----------------
  204.  
  205. The c:Execute command cannot be redirected, does not return error codes, and
  206. might cause other problems.  It will not work at all if it has been renamed.
  207.  
  208. The VDK:  handler and Frank Seidel's BootRam-Handler have a bug with setting
  209. file  dates,  so  when  using  the copy command you should try the -d and -p
  210. switches, otherwise your file date will be bad.  (This is not a shell bug)
  211.  
  212. If  using  it with conman you may consider starting shell with the -a switch
  213. to  turn  off  shell's command line editing and use conmans instead.  You'll
  214. lose, however, many shell features like file name completion.
  215.  
  216. CB-handler  (a tool that installs a scrollbar in the CLI window) is not 100%
  217. compatible  with  cshell.  The log will not always represent the real screen
  218. contents.
  219.  
  220.  
  221. IV. NOTES ON PIPES
  222. ------------------
  223.  
  224.     PIPES
  225.     PIPES  have  been implemented using temporary T:  files.  Thus, you
  226.     should be  careful  when  specifying  a 't:*' expansion as it might
  227.     include the temporary files. These files are deleted on completion
  228.     of the pipe segment.
  229.  
  230.     The file names used are completely unique, even with multiple shell
  231.     running simultaneously.
  232.  
  233.     My  favorite  new  feature is the fact that you can now redirect to
  234.     and  from,  and pipe internal commands.  'echo charlie >ram:x', for
  235.     instance.  Another favorite:
  236.  
  237.     echo "echo mem | csh" | csh
  238.  
  239.     No BCPL program should be output-append redirected (>>).
  240.  
  241.  
  242. V.  COMMAND PRE-PROCESSOR
  243. -------------------------
  244.  
  245.     PREPROCESSING
  246.     Preprocessing is done on the command line before it is passed on to
  247.     an internal or external routine:
  248.  
  249.     ^c    where c is a character is converted to that control
  250.         character. Thus, say '^l' for control-l.
  251.  
  252.     \233    insert character code 233 octal. Do not use values between
  253.         200o and 232o, as they have special meanings. \240 is the
  254.         word separator.
  255.  
  256.     $name    where name is a variable name. Variable names can consist
  257.         of 0-9, a-z, A-Z, and underscore (_).  The contents of the
  258.         specified variable is used.  If the shell variable doesn't
  259.         exist, csh tries to find a local or global (ENV:) variable
  260.         of the same name. If that fails, too, "$name" is inserted.
  261.         That is, if the variable 'i' contains 'charlie',
  262.         then '$i' -> 'charlie'.
  263.         If the variable 'i' doesn't exist, then '$i' -> '$i'.
  264.  
  265.     ;    delimits commands.   echo charlie ; echo ben.
  266.  
  267.     ' '    (a space). Spaces delimit arguments.
  268.  
  269.     "string" a quoted string. Trailing quotes are optional.
  270.         For instance, if you want to echo five spaces and an 'a':
  271.  
  272.         echo      a       -> a
  273.         echo "    a"      ->      a
  274.  
  275.     \c    override the meaning of special characters.
  276.         '\^a' is a circumflex and an a rather than control-a.
  277.         To get a backslash, you must say '\\'.
  278.  
  279.         also used to overide alias searching for commands.
  280.  
  281.     >file    specify output redirection.  All output from the command is
  282.         placed in the specified file.
  283.  
  284.     >>file    specify append redirection
  285.         (Does not work with BCPL programs).
  286.  
  287.     <file    specify input redirection. The command takes input from the
  288.         file rather than the keyboard (note: not all commands
  289.         require input; it makes no sense to say 'echo <charlie'
  290.         since the 'echo' command only outputs its arguments).
  291.  
  292.     |    PIPE specifier.  The output from the command on the left
  293.         becomes the input to the command on the right.  The current
  294.         SHELL implementation uses temporary files to store the data.
  295.  
  296.     !!    execute the previously executed command.
  297.     !nn    (nn is a number).  Insert the history command numbered n
  298.         (see the HISTORY command)
  299.     !partial search backwards through the history list for a command
  300.         which looks the same as 'partial', and execute it.
  301.  
  302.     #    enter comment.  The rest of the line is discarded.
  303.         (note: \# will, of course, overide the comment character's
  304.                special meaning)
  305.  
  306.     {e hi;e ho} executes two commands as one, so they can be redirected
  307.         together (see ALIAS command). The trailing curly brace is
  308.         optional.
  309.  
  310.     $(foo)    insert the stdout of the command 'foo' at this position of
  311.         the command line. Every line of the output will count as one
  312.         argument. The closing parenthesis is optional.
  313.  
  314.     `foo`    insert the stdout of the command 'foo' at this position of
  315.         the command line. Every blank separated word will count as
  316.         one argument. Leading, trailing and multiple blanks will be
  317.         removed. The trailing backtick is optional.
  318.  
  319.     $nn    (nn is a number).  Cshell scripts only!
  320.         Insert argument number nn for $nn.  Thus, $1 becomes the
  321.         first argument, $2 the second, $3 the third and so on.
  322.         $0 is the name of the command (script).  If there's no
  323.         argument nn then $nn remains unchanged (unset variable).
  324.  
  325.     $#    Number of arguments.  Cshell scripts only!
  326.         For example: if $# is 3 then $3 will be the highest
  327.         meaningful variable for an argument.
  328.  
  329.     --    stop option parsing here. Works for internal commands only.
  330.         Example: rm -- -x will remove the file '-x'
  331.  
  332.     Please note the subtle differences between
  333.         alias count {echo one;echo two}
  334.         alias count "echo one;echo two
  335.     The first form will create an alias that contains a local alias. The
  336.     other will create a plain alias. Also, things within braces will not
  337.     be parsed more than once, therefore a backslash needs not be pre-
  338.     ceded by a pair of backslashes. Thus the commands look the same as
  339.     if they were to be typed in at the prompt. To echo lots of '#',
  340.     either use:
  341.         forever {echo \#
  342.         forever "echo \\\#
  343.     A block can spread over several lines. Refer to the SOURCE command.
  344.  
  345.  
  346. VI. COMMAND LINE EDITING
  347. ------------------------
  348.  
  349.     o The command line can be up to 255 chars.
  350.     o Inserts  and  deletes  are handled correctly over multiple lines.
  351.     o The script 'menu.sh' installs an intuition menu that contains most
  352.       editing functions
  353.  
  354.     EDITING
  355.  
  356.     -- MOVING --
  357.     Left Arrow      One character left
  358.     Right Arrow      One character right
  359.     Shift-Left Arrow  One word left
  360.     Shift-Right Arrow One word right
  361.     ESC-Left Arrow      Beginning of line (^A) (^Z)
  362.     ESC-Right Arrow      End of line       (^E)
  363.     -- DELETING --
  364.     Backspace      Previous character
  365.     Del          Character under cursor
  366.     ESC-Backspace      Previous word     (^W)
  367.     ESC-Del          Next word
  368.     ESC-x-Backspace      To start of line  (^B)
  369.     ESC-x-Del      To end of line    (^K)
  370.     ESC-d          Entire line       (^X)
  371.     -- HISTORY --
  372.     Up Arrow      Recall previous commands
  373.     Down Arrow      Recall commands
  374.     Shift-Up Arow      Get history from partial (or number)
  375.     Shift-Down Arrow  Go below last command of history
  376.     ESC-Up Arrow      Get start of history
  377.     ESC-Down Arrow      Get end of history
  378.     ESC-!          Get history from partial (or number)
  379.     ^T          Insert tail (all but first word) of previous line
  380.     ^P          Duplicate previous word (useful for mv)
  381.     -- COMPLETION --
  382.     TAB          Inserts first matching file name
  383.     Shift-TAB      Inserts longest common substring
  384.     ESC-TAB          Inserts all matching file names (also ESC-*)
  385.     ESC-c          Does a quick cd on left word (TAB for cycling)
  386.     ESC-~          Inserts the last current directory
  387.     ^D          Shows all files that match a pattern (also ESC-=)
  388.     -- EXECUTING LINE --
  389.     Return          Executes line
  390.     ESC-Return      Executes this line of history & brings up next one
  391.     ^N          Next line. Don't exec this one but store history
  392.     ^\          EOF (directly exits)
  393.     -- MISCELLANEOUS --
  394.     ^L          Retype current line.
  395.     ^O          Echo a ^O
  396.     ^R          Repeat last command (don't play with this)
  397.     ^U          Undo/Redo last edit
  398.     ESC-i          Toggle Insert/Overwrite
  399.     f1-f10          Execute command if variable exists.
  400.     F1-F10          More commands (Shifted f keys).
  401.     Help          Invokes help command
  402.  
  403. Whenever  the  cursor is placed on or directly after an incomplete file name
  404. and   you   press  TAB,  CShell  inserts  for  the  first  filename  (sorted
  405. alphabetically) that matches the name part already typed.  Any wildcards are
  406. allowed  here, if none are given, '*' is appended.  Immediately pressing TAB
  407. again  brings  up  the next file name that matched the substring.  Shift-TAB
  408. will  only  insert  the  as much as is common to all files that matched your
  409. abbreviation.  If pressed again, behaves just like TAB.  ESC-Tab inserts the
  410. name  of the directory where you would have ended up with a quick cd to that
  411. substring.
  412.  
  413. Note that ^D now means 'quit batchfile' like under AmigaDOS and is no longer
  414. used for quitting CShell.  If you want it back, enter 'keymap 0 4=41'
  415.  
  416. The  CTRL  keys  FGVY  are unset, feel free to map them to any function (see
  417. chapter XV).  You can also remap all preset keys.
  418.  
  419. VII. FUNCTION KEYS
  420. ------------------
  421.  
  422.     FUNKEY
  423.     Function keys now insert text to the current position on the command
  424.     line. They may be terminated with a ^M (return). f1 would be non-
  425.     shifted where as F1 is shifted.
  426.     Most of functions key have a default definition, but it may be
  427.     changed.
  428.  
  429.         $ set f1 dir df0:^M
  430.  
  431.     will add the text 'dir df0:<return>' to the current line.
  432.  
  433.         $ set f1 dir
  434.  
  435.     would only add 'dir' you could then enter ' df0:<return>'
  436.  
  437.  
  438. VIII. SHELL COMMANDS
  439. --------------------
  440.  
  441.     STARTUP OPTIONS
  442.     First to start shell from a CLI:
  443.  
  444.     csh [-abcCfiknstv] [-c command;command]
  445.     csh [-abcCfiknstv] [batchfile1 ... batchfileN]
  446.  
  447.      -a  AUX: mode. No command line editing and text highlighting
  448.      -b  starts shell in background, which means only task priority -1.
  449.      -c  allows execution of one command line and then exits out
  450.          of  shell.   This  is  useful for running an internal shell
  451.          commands in the background or from an external application:
  452.         run csh -c "dir df0:; copy -r df0: df1: >nil:; echo Done"
  453.      -C  same as -c, but the command line is not parsed twice. This
  454.          allows passing of file names with blanks within.
  455.         run csh -C rm "Ram Disk:tempfile"
  456.      -f  starts shell in foreground, which means only task priority 1.
  457.          you might reset this prioritiy to 0 at the end of your .login
  458.      -k  sets _nobreak before doing anything
  459.      -n  suppresses starting of s:.login
  460.      -N  suppresses starting of s:.cshrc
  461.      -s  globally enables the asterisk * as alias for #? in AmigaDOS 2.0
  462.          This means you can use * inside file requesters as well.
  463.          (obsolete option -- * is default -- #? is still allowed !!)
  464.      -t  terminal mode. You can use command line editing and text high-
  465.          lighting on a VT100 compatible terminal. To swap backspace
  466.          and DEL, refer to the 'keymap' command
  467.      -v  sets _verbose to 'hs' before doing anything.
  468.  
  469.     COMMAND EXECUTION
  470.  
  471.     Internal shell commands are case sensitive and may be abbreviated.
  472.  
  473.    The first argument is the command-name... here is (in order) how Shell
  474.    tries to execute it:
  475.  
  476.     1)  The alias list is searched for an alias with an exactly
  477.         matching name.
  478.     2)  Internal commands list is scanned for a command even partially
  479.         matching name (so you can, for instance, say resi for resident;
  480.         however, you should specify enough of a command to be unique).
  481.     3)  Then, the list of functions is scanned for a command that
  482.         matches completely. If one is found, the result of the function
  483.         is echoed to stdout.
  484.     4)  Now the command is assumed to be external.
  485.         Arguments with blanks, semicolons or empty strings will be
  486.         surrounded by quotes.
  487.     5)  If the file is a directory, a 'cd <file>' will be performed to
  488.         it.
  489.     6)  AmigaDOS resident list are scanned for it (you can use Shell's
  490.         'resident' command to add/remove a file in the DOS list).
  491.     7)  If the file is in the current directory and it's executable, it
  492.         is started.
  493.     8)  Then it is searched in the AmigaDOS path and c:
  494.     9)  Now, the shell path ($_path) is searched. If it's found and
  495.         executable, it's started. If it has the 's' bit set, it will
  496.         be executed using the appropriate shell. See FOREIGN SHELLS
  497.     10) If there exists a file with the suffix '.sh' and the same root
  498.         in the current directory or in the shell path, it is 'source'd.
  499.     11) Then the variable _rxpath is examined. If there exists a file
  500.         with the suffix '.rexx' and the same root in the current direc-
  501.         tory or in '$_rxpath', 'RX <file>' will be performed.
  502.     12) If all failed, an 'exec' action is sent to the file. See chapter
  503.         XIV for more info on classes and actions.
  504.  
  505.     To enforce that the external 'dir'-command is used, enter 'Dir'. It
  506.     is a good habit to uppercase the first letter of all external com-
  507.     mands, even if this is not necessary.
  508.  
  509.     AUTOMATIC SOURCING may be accomplished by naming shell scripts with
  510.     a .sh suffix.  Thus, if you say 'stuff' and the file 'stuff.sh'
  511.     exists in your current or anywhere in Shell search path (NOTE:
  512.     won't be found in the AmigaDOS path), it will be SOURCED with all
  513.     arguments you have given placed in the $_passed variable.  This is
  514.     equivalent to typing 'source stuff.sh'
  515.  
  516.     FOREIGN SHELLS are supported through key characters at the beginning
  517.     of their scripts.  If a file in $_path has the s-bit set, the first
  518.     few bytes are read.  If the first two are either '#!' or ';!', the
  519.     rest of the first line will be interpreted as the name of the shell
  520.     that is supposed to execute the script.  If they are '/*', the
  521.     command 'RX' is used, if none of the above, 'c:Execute'.
  522.     Example:
  523.       #!SKsh -c source
  524.  
  525.     WILDCARDS
  526.     Most shell commands will accept multiple arguments that can
  527.     be as a result of wild card expansion.  Also when calling
  528.     an external command shell will first expand any wild cards
  529.     to separate arguments.  If you wish to have the external command
  530.     handle it's own wild carding you will need to insert quotes
  531.     around the special wild card characters or use an alias (see
  532.     explanation of 'alias')
  533.  
  534.     eg.
  535.         arc a new.arc *.txt    - shell will expand and pass to arc
  536.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  537.         alias arc "*a Arc $a"    - now shell will never expand
  538.  
  539.     The patterns are fairly extensive, and approximate some of the
  540.     ability of Unix/grep "regular expression" patterns.  Here are the
  541.     available tokens:
  542.  
  543.     ?    Matches a single character.
  544.     #    Matches the following expression 0 or more times.
  545.     (ab|cd)    Matches any one of the items seperated by '|'.
  546.     ~    Negates the following expression.  It matches all strings
  547.         that do not match the expression (aka ~(foo) matches all
  548.         strings that are not exactly "foo").
  549.     [abc]    Character class: matches any of the characters in the class.
  550.     [~bc]    Character class: matches any of the characters not in the
  551.         class.
  552.     a-z    Character range (only within character classes).
  553.     %    Matches 0 characters always (useful in "(foo|bar|%)").
  554.     *    Synonym for "#?", not available by default in 2.0. Available
  555.         as an option that can be turned on.
  556.  
  557.     "Expression" in the above table means either a single character
  558.     (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  559.     class (ex: "#[a-zA-Z]").
  560.  
  561.     Additional wildcards allowed:
  562.  
  563.     .../*    recursive search down ALL sub directories from current level
  564.     !    synonym for ~, supported for compatibility
  565.     &    prefixed to patterns, ask confirmation for each file
  566.     ~    the previous current directory (if separated)
  567.     Note that a pattern must contain a '?' or a '*', otherwise the other
  568.     special characters are not recognized. Furthermore, you cannot spe-
  569.     cify a single '?' as a pattern in the first argument to a command,
  570.     as this will be passed on to the command in order to show its usage.
  571.     If pattern.library is present it LIBS:, it will be used for the
  572.     matching.
  573.  
  574.     Examples:
  575.  
  576.     df0:.../*    all files in all directories on df0:
  577.     df0:.../!*.info    full directory tree of df0: but exclude
  578.             any ugly .info files.
  579.     !*.o !*.c    will result in ALL files matching since what
  580.             doesn't match the !*.o will match the !*.c
  581.     df1:&*        all files in root of df1:, but ask
  582.             confirmation for each
  583.     *.[co]        all files ending in .c or .o
  584.     ~*.[co]        all files NOT ending in .c nor in .o
  585.     ~        the previous current directory
  586.     ~/*.c        all .c files in the previous current directory
  587.     ~//        the parent of the previous current directory
  588.     .        the current directory
  589.     ./foo.c        the same as foo.c
  590.     ..        the parent of the current directory
  591.     ../foo.c    the file foo.c in the parent directory
  592.  
  593.     Note that some commands prevent wild card expansion. These are:
  594.       - dir, rpn, whereis, window
  595.     Those commands will expand the wild cards themselves. This is why
  596.       dir @without( *.? , *.o )
  597.     will not work. Instead use:
  598.       set arg @without( *.? , *.o );dir $arg
  599.  
  600.     There is one exception to the rules given above: A single '?' as
  601.     the first argument will *not* expand in order to allow you to get
  602.     the usage of CLI and csh commands easily.
  603.  
  604.     The   following   symbols  are  not  yet  supported  by  wild  card
  605.     expansions, but are accepted in search -w and @match( ):
  606.  
  607.     ( | )    OR matching
  608.     #    0 or more times the pattern following
  609.  
  610.     Examples:
  611.  
  612.     "k#a"        matches ka, kaa, kaaa, etc.
  613.     "hel(lo|p)"    matches hello or help.
  614.  
  615.  
  616. LIST OF COMMANDS:
  617. -----------------
  618.  
  619.     ABORTLINE
  620.     Usage    : abortline
  621.     Example    : echo a;abort;echo b
  622.     Results    : a
  623.  
  624.     Causes the rest of the line to be aborted. Intended for use in
  625.     conjunction with exception handling.
  626.  
  627.     ACTION
  628.     Usage    : action [-a] actionname file [arguments]
  629.     Example : action extr csh515.lzh csh.doc
  630.  
  631.     Sends an action to a file. See chapter XIV CLASSES
  632.     Options:
  633.      -a (abort) returns 0 if failed and 1 if successful. Otherwise,
  634.                 normal error codes (10 or 11) are returned
  635.  
  636.     ADDBUFFERS
  637.     Usage    : addbuffers drive
  638.           addbuffers drive buffers [drive buffers ...]
  639.     Example    : addbuffers df0: 24
  640.  
  641.     Just like AmigaDOS addbuffers command, causes new buffers to be
  642.     allocated for disk I/O.  Each buffer costs 512 bytes of memory,
  643.     CHIP memory if a disk drive. Buffers may be negative (to remove
  644.     buffers from a drive).
  645.  
  646.     To show actual amount of buffers use "addbuffers drive"
  647.     or "addbuffers drive 0".
  648.  
  649.     ADDPART
  650.     Equivalent to tackon.
  651.  
  652.     ALIAS
  653.     Usage    : alias [name [command string] ]
  654.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  655.  
  656.     Sets a name to be a string. You can alias a single name to a set
  657.     of commands if you enclose them in quotes as above. By simply
  658.     typing vt, the command line above would be executed.
  659.     Aliases may call each other, but direct recursion is prohibited,
  660.     so the following works: alias ls "ls -s"
  661.     To prevent alias replacement, enter: \ls
  662.  
  663.     By typing "alias name", you will get the alias for that name, while
  664.     with "alias" you get a list of all alias.
  665.  
  666.     ARGUMENT PASSING TO AN ALIAS:
  667.  
  668.     Usage    : alias name "%var[%var...] [ command_string ]"
  669.           alias name "*var[%var...] [ command_string ]"
  670.     Example    : alias xx "%q%w echo hi $q, you look $w
  671.           xx Steve great today
  672.     Results    : hi Steve, you look great today
  673.  
  674.     The second form of the alias command allows passing of arguments
  675.     to any position within the command string via use of a variable
  676.     name. To pass arguments to the end of a command string this method
  677.     is actually not necessary. These variables are local, so they don't
  678.     destroy another variable with the same name.
  679.     If you specify multiple arguments, every argument will be assigned
  680.     one word, and the last argument will be assigned the rest of the
  681.     command line.
  682.  
  683.     Using a '*' instead of the first '%' prevents wild card expansion:
  684.         alias zoo "*a zoo $a
  685.     To expand the wild cards after you got them, use
  686.         exec set a $a
  687.  
  688.     IMPLICIT ALIASES:
  689.  
  690.     Usage    : {command;command}
  691.           {%var command;command} arg arg
  692.     Example    : {%tmp echo $tmp $tmp} hello    --> hello hello
  693.  
  694.     Curly braces define temporary aliases. They can be redirected as
  695.     a whole, can have arguments and local variables. They count as
  696.     one argument, even if there are blanks inside (as with quotes), and
  697.     they may be nested. Complex alias definitions can use the braces
  698.     instead of quotes, although this will add some calling overhead.
  699.     The closing curly brace is optional if at the end of line.
  700.     Example:
  701.  
  702.     alias assert {e "Are you sure? ";input -s sure
  703.  
  704.     ASCII
  705.     Usage    : ascii
  706.           ascii string
  707.  
  708.     If called without arguments, ascii outputs a complete ASCII table.
  709.     Given a string, shows each character in ASCII. Options:
  710.       -h shows numbers in hexadecimal
  711.       -o shows numbers in octal
  712.  
  713.     ASSIGN
  714.     Usage    : assign
  715.           assign logical
  716.           assign [-adlnp] logical1 physical1 [log2 phy2 ... ]
  717.  
  718.     The first form shows all assigns.
  719.     The second form kills one assign.
  720.     The third form assigns logical1 to physical1 and so on.
  721.     Options:
  722.      -a adds a new path to an existing assign
  723.      -d creates a deferred (late-binding) assign
  724.          (identical with old option -l)
  725.      -p creates a path (non-binding) assign
  726.          (identical with old option -n)
  727.     For definition of add/defer/path, refer to your AmigaDOS manual.
  728.  
  729.     BASENAME
  730.     Usage    : basename var path [path ...]
  731.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  732.  
  733.     Sets var specified to basenames of paths.
  734.  
  735.     CAT
  736.     Usage    : cat [-n][file file....]
  737.     Example    : cat foo.txt
  738.  
  739.     Type the specified files onto the screen.  If no file is specified,
  740.     STDIN in used (note: ^\ is EOF).  CAT is meant to output text files
  741.     only. Specifying -n option you will output numbered lines.
  742.  
  743.     CD
  744.     Usage    : cd [path]
  745.           cd -g device1 [device2 [device3 ...]]
  746.  
  747.     Change your current working directory.  You may specify '..' to go
  748.     back one directory (this is a CD specific feature, and does not
  749.     work with normal path specifications).
  750.  
  751.     In most cases, you'll no more have to use the CD command. Just type
  752.     the desired directory at the prompt (very handy in conjunction with
  753.     file name completion). Typing a ~ alone on a command line cd's
  754.     to previous current directory.
  755.  
  756.     There are two situations left when you still need it:
  757.  
  758.     Entering 'cd *tem' will cd to the first name matched.
  759.  
  760.     The second form generates a list (an ASCII file) of all direc-
  761.     tories on the given devices. It will be stored in the file given
  762.     in $_qcd (default: 'csh:csh-qcd'). Note that this ASCII file will
  763.     not be merged but overwritten. Once you have generated this file,
  764.     you can cd to any directory on your harddisk(s) even if it's not
  765.     in the current directory.
  766.     If you have two directories of the same name and you use one of
  767.     them more, move the more important one to the beginning of the
  768.     qcd file. You might also sort the file.
  769.     It is legal to type just an abbreviation of the directory name
  770.     you want to cd to. No asterisk '*' necessary. If you end up in
  771.     the wrong directory, cd to the same directory again (best done
  772.     by Cursor-Up + RETURN). You will cycle through all directories
  773.     that matched the given abbreviation. The other possibility is to
  774.     specify the full name of the parent directory: cd devs/keym
  775.     You may also add devices and assigns, so if 'PageStream:' is one
  776.     line in the qcd-file, a cd to 'page' is successful.
  777.  
  778.     CD without any arguments displays the path of the directory you
  779.     are currently in.
  780.  
  781.     CHMOD
  782.     Usage    : protect [+|-|=][flags] file1 ... filen
  783.     Example    : protect +rwe myfile
  784.  
  785.     Set AMIGADOS file protection flags for the file specified. Valid
  786.     flags are h, s, p, a, r, w, e, d. x ist the same as e. Modes:
  787.       +  Set specified bits, leave all others
  788.       -  Clear specified bits, leave all others
  789.       =  Set specified bits, clear all others
  790.     Specifying no mode is equal to '='. Archive bit cleared by default.
  791.  
  792.     Note: This command is equivalent to "protect" except that the
  793.           arguments for filename(s) and flag(s) are reversed.
  794.  
  795.     CLASS
  796.     Usage    : [-n] name {type=param} [ "actions" {action=command} ]
  797.     Example : class zoo offs=20,dca7c4fd ext=.zoo actions view="zoo l"
  798.  
  799.     Defines a new class of files and the actions to be taken on them
  800.     in various cases, or shows old definitions if given no arguments.
  801.     See section XIV: OBJECTS
  802.     Options:
  803.       -n (new)  forgets old definitions
  804.  
  805.  
  806.     CLOSE
  807.     Usage    : close [filenumber]
  808.  
  809.     Close the specified file opened by open. Without filenumber, closes
  810.     all open files. See open and flist for more info.
  811.  
  812.     CLS
  813.     Usage    : cls
  814.  
  815.     This is an alias. It only clears the screen, but also works on a
  816.     terminal (echo ^L doesn't).
  817.  
  818.     COPY
  819.     Usage    : copy [-udfpm]  file file
  820.     or    : copy [-udfpm]  file1 file2...fileN dir
  821.     or    : copy [-rudfp] dir1...dirN file1...fileN dir
  822.  
  823.     Options    :
  824.      -r recursive, copy all subdirectories as well.
  825.      -u update, if newer version exists on dest, don't copy
  826.      -f freshen, if file doesn't exist on dest or newer, don't copy
  827.      -q suppresses 'not newer' and 'not there' messages in -u and -f
  828.      -d don't set destination file date to that of source.
  829.      -p don't set destination protection bits to those of source.
  830.      -m erases the original. does not work with -r
  831.      -o overwrites write/delete-protected, reads read-protected
  832.  
  833.     Example    : copy -r df0: df1:
  834.  
  835.     Copy files or directories. When copying directories, the -r option
  836.     must be specified to copy subdirectories as well.  Otherwise, only
  837.     top level files in the source directory are copied.
  838.  
  839.     All files will be displayed as they are copied and directory's
  840.     displayed as they are created. This output can be suppressed by
  841.     redirecting to nil: eg. copy -r >nil: df0: df1:
  842.  
  843.     Copy will abort after current file on Control-C.
  844.  
  845.     Copy by default sets the date of the destination file to that of
  846.     the source file. To overide this feature use the -d switch.
  847.  
  848.     Similarly, it sets protection bits (flags) to those of source and
  849.     any file comment will be copied. To avoid this use -p. The archive
  850.     bit is always cleared.
  851.  
  852.     Another useful option is the -u (update) mode where copy will not
  853.     copy any files which exists already in the destination directory
  854.     if the destination file is newer or equal to the source file.
  855.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  856.     when done you can copy -u ram: df1: and only those modules you have
  857.     modified will be copied back.
  858.  
  859.     Copy command will now create the destination directory if it does
  860.     not exist when specified as 'copy [-r] dir dir'. If you specify
  861.     copy file file file dir, then 'dir' must already exist.
  862.  
  863.     CP
  864.     Equivalent to copy.
  865.  
  866.     DATE
  867.     Usage    : date [-sr] [new date and/or time]
  868.     Example    : date Wednesday  # this refers to NEXT wed, of course
  869.  
  870.     Options:
  871.       -s stores the current time internally
  872.       -r shows time relative to last stored in secs and hundredths
  873.  
  874.     Used to read or set system date and/or time. All standard options
  875.     may be used (yesterday, tomorrow, monday, etc.).
  876.     Leading zero's are not necessary.
  877.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  878.  
  879.     DEC
  880.     Usage    : dec varname [value]
  881.     Example    : dec abc
  882.  
  883.     Decrement the numerical equivalent of the variable with specified
  884.     value (default: 1) and place the ASCII-string result back into
  885.     that variable.
  886.  
  887.     DELETE
  888.     Usage    : delete [-fpqrv] file file file...
  889.     Example    : delete foo.txt test.c
  890.  
  891.     Remove (delete) the specified files.  Remove always returns
  892.     errorcode 0.  You can remove empty directories.  The '-r' option
  893.     will remove non-empty directories by recursively removing all sub
  894.     directories.
  895.     You can remove delete-protected files specifying -p (or -f) option.
  896.     If you specify any wildcard deletes the files will be listed as
  897.     they are deleted. This can be suppressed by redirecting to nil:
  898.  
  899.     If you specify -q (quit), delete aborts if the file to be removed
  900.     didn't exist or couldn't be deleted.
  901.  
  902.     With -v you can toggle verbose output.  Useful when you have
  903.     an alias for 'delete'.
  904.  
  905.     DIR
  906.     Usage    : dir [-abcdfhiklnoqstuv] [-z [lformat]] [path path ... ]
  907.     Example    : dir -ts downloads:
  908.           dir -lz "%7s %-.16n %m" *.c
  909.     Options:
  910.      -d list directories only
  911.      -f list files only
  912.      -h list only files which not start with a dot, end with '.info' or
  913.         have the h-flag set. Adds an 'i' bit to the flags which tells
  914.         if an according .info file exists.
  915.      -s short multi(4) column display.
  916.      -c don't change colors for directories
  917.      -q quiet display. does not show length in blocks
  918.      -o display file nOtes
  919.      -n display names only
  920.      -p display full path names and suppress directory titles
  921.      -a shows the age of all files in the format  days hours:minutes
  922.      -i identifies every file, shows the type instead of the date.
  923.         See chapter XIV CLASSES
  924.      -v (viewdir) recursively sums up lengths of the files in a dir
  925.      -l sorts the files by their length, longest first.
  926.      -t sorts the files by their time, most recent first.
  927.      -k sorts the files by their class (klass)
  928.      -b sorts the files backwards.
  929.      -g prints directories at the beGinning
  930.      -e prints directories at the End
  931.      -u must be given exactly two directories. Shows files only in
  932.         the first directory, files in both and files in the second.
  933.      -z custom format
  934.  
  935.     Displays a directory of specified files. Default output shows
  936.     date, protection, block size, byte size and total space used.
  937.     Protections flags include new 1.2/1.3 flags (see under protect),
  938.     plus a 'c' flag which indicates that this file has a comment.
  939.     Files are alphabetically sorted, without case sensitivity, and
  940.     directories are in red pen (unless you use -c). Dir takes in
  941.     account the width of your window.
  942.  
  943.     The lformat string is used to create your own directory format.
  944.     Instead of the lformat command line argument you can set the
  945.     variable "_dirformat" (and leave out the lformat argument).
  946.     It will override all else and may contain the following codes:
  947.      %a age               %l LF if comment      %t time
  948.      %b size in blocks    %m multi column       %u size in K
  949.      %c flag c (comment)  %n name               %v dir size in eng.
  950.      %d date              %o filenote (comment) %w dir size in K
  951.      %e flag i (.info)    %p name w/ path       %x translated date
  952.      %f flags hsparwed    %q name w/ slash      %+ flag i as '+' or ' '
  953.      %i flag d (dIr)      %r size in eng.
  954.      %k class             %s size
  955.  
  956.      %I link information (S: softlink, H: hardlink, P: pipe, -: else)
  957.      %L name of original file if link (empty otherwise)
  958.      %N name + original name (of link)
  959.  
  960.     Between the '%' and the identifying letter, there may be an optional
  961.     field width. If the number is preceded by a '-', the field contents
  962.     will be left adjusted. If by a dot, the contents will be cut down
  963.     to match the field width if they are longer.
  964.     If the format string contains a %m, cshell will try to print more
  965.     than one entry on one line. The column width is the field width of
  966.     the %m entry. If omitted, it's assumed to be the one of the first
  967.     file. If a file is longer, it will use two columns.
  968.  
  969.     DISKCHANGE
  970.     Usage    : diskchange drive
  971.  
  972.     Like AmigaDOS diskchange.
  973.  
  974.     ECHO
  975.     Usage    : echo [-en] string
  976.     Example    : echo hi there
  977.     Results    : hi there
  978.  
  979.     Echo the string given. If -n switch given no newline is
  980.     appended. If -e is on, echo to stderr.
  981.  
  982.     ELSE
  983.     Usage    : else ; command
  984.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  985.  
  986.     Else clause, must follow an IF statement.
  987.  
  988.     ENDIF
  989.     Usage    : endif
  990.  
  991.     The end of an if statement.
  992.  
  993.     Note: if you return from a script file with unterminated IF's
  994.     and the last IF was false, prompt will be changed to an
  995.     underscore ('_') and no commands will be executed until
  996.     'endif' is typed.
  997.  
  998.     ERROR
  999.     Usage    : error n
  1000.  
  1001.     Generates return code n.
  1002.  
  1003.     EXEC
  1004.     Usage    : exec [-i] command [args]
  1005.     Example    : set cmdline "dir ram:"
  1006.           exec $cmdline        # would not work without exec
  1007.  
  1008.     Execute the command specified; exec command is equivalent to
  1009.     command, only you can use variables to specify command name.
  1010.     Note that the command line is parsed TWICE! Examples:
  1011.      set a dir ram:; exec $a              # right
  1012.      set a mkdir; exec $a "My directory"  # wrong! creates 2 directories
  1013.  
  1014.     Exec returns the return code of the command executed unless
  1015.     option -i (ignore) is set, in which case always 0 is returned.
  1016.  
  1017.     FAULT
  1018.     Usage    : fault error1 .. errorN
  1019.     Example    : fault 205 212
  1020.  
  1021.     Like AmigaDOS fault, prints specified error messages.
  1022.  
  1023.     FILENOTE
  1024.     Usage    : filenote file1 .. fileN  note
  1025.           filenote -s file1...fileN
  1026.  
  1027.     The first form sets AmigaDOS comment of the specified file.
  1028.     The second form displays the file notes of the given files.
  1029.  
  1030.     FLIST
  1031.     Usage    : flist
  1032.  
  1033.     Lists the filenumbers of files opened by open.
  1034.     See open and close for more info.
  1035.  
  1036.     FLTLOWER
  1037.     Usage    : fltlower
  1038.     Example    : dir | fltlower
  1039.     Or    : fltlower <readme
  1040.  
  1041.     This is a filter command, i.e. it reads from stdin and writes to
  1042.     stdout. The more natural way to use it is a pipe, or it can be
  1043.     redirected.
  1044.     Its purpose is to convert all alphabetic to lower case.
  1045.  
  1046.     FLTUPPER
  1047.     The same of fltlower, only this converts to upper case.
  1048.  
  1049.     FOREACH
  1050.     Usage    : foreach [-v] varname ( strings ) command
  1051.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  1052.     Result    : a ha
  1053.           b ha
  1054.           c ha
  1055.           d ha
  1056.  
  1057.     'strings' is broken up into arguments.  Each argument is placed in
  1058.     the local variable 'varname' in turn and 'command' executed. Put
  1059.     the command(s) in quotes.
  1060.  
  1061.     Foreach is especially useful when interpreting passed arguments in
  1062.     an alias.
  1063.  
  1064.     eg.
  1065.         foreach i ( *.pic ) viewilbm $i
  1066.     assuming a.pic and b.pic in current directory the following commands
  1067.     will occur:
  1068.         viewilbm a.pic
  1069.         viewilbm b.pic
  1070.  
  1071.     Flag -v causes arguments to be displayed every time command is
  1072.     executed. All 'for...' commands can be interrupted using CTRL-D.
  1073.  
  1074.     FOREVER
  1075.     Usage    : forever command
  1076.     or    : forever "command;command;command..."
  1077.  
  1078.     The specified commands are executed over and over again forever.
  1079.  
  1080.     Execution stops if you hit ^C or ^D, or if the commands return with
  1081.     an error code.
  1082.  
  1083.     FORLINE
  1084.     Usage    : forline var filename command
  1085.     or    : forline var filename "command;command..."
  1086.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  1087.  
  1088.     For each ASCII line of file specified commands are executed and
  1089.     var points to line content. You can check system variable _linenum
  1090.     to find the number of the line currently read.
  1091.     If STDIN (case sensitive) is specified as input file, the lines are
  1092.     read from standard input.
  1093.  
  1094.     FORNUM
  1095.     Usage    : fornum [-v] var n1 n2 command
  1096.     or    : fornum [-v] -s var n1 n2 step command
  1097.     Example    : fornum -v x 1 10 echo $x
  1098.     or    : fornum -s x 10 1 -1 echo $x # counts backwards
  1099.  
  1100.     Executes  command(s)  for  all numerical values of x between n1 and
  1101.     n2.   If  more  than  one  command  is  specified,  or  command  is
  1102.     redirected, include command(s) in quotes.
  1103.     Switch -v (verbose) causes printing of progressive numbers.
  1104.     Switch  -s  allows  you to specify a step; if this is negative, the
  1105.     count will be backwards.
  1106.  
  1107.     GETENV
  1108.     Usage    : getenv [shellvar] envvar
  1109.  
  1110.     Gets the value of an ENV: variable and stores it in the shell
  1111.     variable 'shellvar'. If shellvar is omitted, the value of the
  1112.     ENV: variable is printed to stdout.
  1113.     This command is obsolete since ENV: variables can be retrieved
  1114.     by writing $envvar anywhere on the command line.
  1115.  
  1116.     GOTO
  1117.     Usage    : goto label
  1118.     Example    :
  1119.           label start
  1120.             echo "At start"
  1121.             dir ram:
  1122.             goto start
  1123.  
  1124.     Goto  the specified label name.  You can only use this command from
  1125.     a  source  file.   Labels  may  be  forward or reverse from current
  1126.     position. It is legal to jump out of if's.
  1127.  
  1128.     HEAD
  1129.     Usage    : head [filename] [num]
  1130.     Example    : head readme 20
  1131.  
  1132.     Display first "num" lines of "filename".   If num is not specified,
  1133.     10 is assumed. If filename is not specified, standard input (stdin)
  1134.     is taken instead.
  1135.  
  1136.     HELP
  1137.     Usage    : help [-f]
  1138.     Example    : help
  1139.     Options    :
  1140.      -f list functions also
  1141.  
  1142.     Simply  displays  all  the  available  commands.   The commands are
  1143.     displayed in search-order.  That is, if you give a partial name the
  1144.     first  command  that  matches  that  name  in  this list is the one
  1145.     executed.   Generally,  you  should  specify enough of a command so
  1146.     that it is completely unique.
  1147.  
  1148.     HISTORY
  1149.     Usage    : history [-nr] [partial_string]
  1150.     Example    : history
  1151.     Options    :
  1152.      -n omits line numbering
  1153.      -r reads history from stdin
  1154.  
  1155.     Displays  the  enumerated  history  list.   The size of the list is
  1156.     controlled  by  the  _history  variable.   If you specify a partial
  1157.     string, only those entries matching that string are displayed.
  1158.  
  1159.     HOWMANY
  1160.     Usage    : howmany
  1161.  
  1162.     This  command  tells you how many instances of Shell are running in
  1163.     your system.
  1164.  
  1165.     HTYPE
  1166.     Usage    : htype [-r] [file1..fileN]
  1167.  
  1168.     Displays the specified files in hex and ASCII, just like the system
  1169.     command 'Type file opt h'.  Especially suitable for binary files.
  1170.     If -r is specified, htype displays all files in a directory.
  1171.  
  1172.     If there are no filenames specified, standard input is used,
  1173.     so you can use htype as the destination for a pipe.
  1174.  
  1175.     IF
  1176.     Usage    : if [-n] argument conditional argument [then]
  1177.     or    : if [-n] argument
  1178.     or    : if [-n] -f file    or   -e file
  1179.     or    : if [-n] -d file/dir
  1180.     or    : if [-n] -m
  1181.     or    : if [-n] -t file file1 .. fileN
  1182.     or    : if [-n] -r rpnexpression
  1183.     or    : if [-n] -v varname
  1184.     or    : if [-n] -o char arg ... arg
  1185.  
  1186.     Makes the following instructions up to the next endif conditinal.
  1187.     The 'then' is optional. The if clause must be followed by a semi-
  1188.     colon if instructions follow on the same line.
  1189.  
  1190.     If a single argument is something to another argument.  Conditional
  1191.     clauses allowed:
  1192.  
  1193.     <, >, =, ! and combinations.  Thus != is not-equal, >= larger or
  1194.     equal, etc...
  1195.  
  1196.     If arguments are not numeric, they are compared as strings.
  1197.  
  1198.     Usually the argument is either a constant or a variable ($varname).
  1199.  
  1200.     The second form if IF is conditional on the existence of the
  1201.     argument.  If the argument is a "" string, then FALSE, else TRUE.
  1202.  
  1203.     The third form of IF used by -f switch checks for existance of
  1204.     the specified file. -e is the same as -f
  1205.  
  1206.     Switch -d tests the type of the object specified: if it is a
  1207.     directory, then TRUE; if it is a file (or it doesn't exist)
  1208.     then FALSE.
  1209.  
  1210.     Switch -m is used to test if FAST memory is present.
  1211.     Example (to be included in a login.sh file):
  1212.     if -m; resident -d lc1 lc2 blink; endif
  1213.  
  1214.     Using -t form compares the date and time of the first file with
  1215.     all the others; if the first is younger than ALL the others, then
  1216.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  1217.     being older.
  1218.     This feature is especially useful for building makefiles without
  1219.     using any MAKE utility.
  1220.     Example:
  1221.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  1222.  
  1223.     Option -r evaluates a given RPN expression (see under RPN for more
  1224.     info): if value on top of stack is 0, then FALSE, else TRUE.
  1225.  
  1226.     Option -o tests for option 'char' in the rest of the arguments.
  1227.     Example: if -o r -rp ram:comm1.c     will yield TRUE.
  1228.  
  1229.     Switch -n (NOT) reverses the result.
  1230.  
  1231.     To test if a given variable is defined, use if -v varname.
  1232.  
  1233.     When using 'IF' command interactively if you are entering commands
  1234.     following an 'IF' that was false, the prompt will be set to a
  1235.     underscore '_ ' to indicate all commands will be ignored until
  1236.     an 'ELSE' or 'ENDIF' command is seen.
  1237.  
  1238.     INC
  1239.     Usage    : inc varname [value]
  1240.     Example    : inc abc 5
  1241.  
  1242.     Increment the numerical equivalent of the variable with specified
  1243.     value (default: 1) and place the ASCII-string result back into
  1244.     that variable.
  1245.  
  1246.     INFO
  1247.     Usage    : info [-pt] [path1 path2 ... pathN]
  1248.     Options    :
  1249.      -p  only display drives with readable (present) disks
  1250.      -t  print disk/fs type and bytes used instead of block sizes
  1251.  
  1252.     If called without arguments, info gives you the drive information
  1253.     on all devices. If one or more paths are specified, only infor-
  1254.     mation on those drives will be displayed.
  1255.  
  1256.     Note: Cshell does (correct) rounding for all displayed values,
  1257.           Commodore's Info command does not. So values may slightly
  1258.           change.
  1259.  
  1260.     INPUT
  1261.     Usage    : input [-s] var var ... var
  1262.     Example    : input abc
  1263.  
  1264.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  1265.     next input line is broken up in words (unless quoted) and placed in
  1266.     the variable. If -s is turned on, the whole line is read in as one
  1267.     word, including spaces. -r puts the console to single character mode
  1268.     before reading (ie. does not wait for RETURN to be pressed). Use
  1269.     this with care.
  1270.  
  1271.     JOIN
  1272.     Usage    : join [-r] file1..fileN destfile
  1273.     Example    : join part1 part2 part3 total
  1274.  
  1275.     Joins the specified files to get destfile. If destfile already
  1276.     exists, an error message is generated and operation is aborted,
  1277.     unless you specify -r (replace) option.
  1278.  
  1279.     KEYMAP
  1280.     Usage    : keymap [number {key=function}]
  1281.     Example    : keymap 0 1030=4 1032=12
  1282.  
  1283.     Defines one keymap for the csh command line editing. See chapter XV.
  1284.  
  1285.     LABEL
  1286.     Usage    : label name
  1287.  
  1288.     Create a program label right here. Used in source files, you can
  1289.     then GOTO a label.
  1290.  
  1291.     LINECNT
  1292.     Another filter. Counts the number of lines of its stdin and writes
  1293.     it to stdout.
  1294.  
  1295.     LN
  1296.     Usage    : ln [-s] filename [linkname]
  1297.     Example    : ln stuff/data newname
  1298.     Options    :
  1299.      -s make soft link (default is hard link)
  1300.  
  1301.     ln creates an additional directory entry, called a link,  to
  1302.     a file or directory.  Any number of links can be assigned to
  1303.     a file.
  1304.  
  1305.     filename is the name of  the  original  file  or  directory.
  1306.     linkname  is  the  new  name  to  associate with the file or
  1307.     filename.  If linkname is omitted,  the  last  component  of
  1308.     filename is used as the name of the link.
  1309.  
  1310.     A hard link (the default) is a standard directory entry just
  1311.     like the one made when the file was created.  Hard links can
  1312.     only be made to existing files.  Hard links cannot  be  made
  1313.     across file systems (disk partitions, mounted file systems).
  1314.     To remove a file, all hard links  to  it  must  be  removed,
  1315.     including  the  name by which it was first created; removing
  1316.     the last hard link releases the inode  associated  with  the
  1317.     file.
  1318.  
  1319.     A symbolic link, made with  the  -s  option,  is  a  special
  1320.     directory entry that points to another named file.  Symbolic
  1321.     links can span file systems and point  to  directories.   In
  1322.     fact,  you  can create a symbolic link that points to a file
  1323.     that is currently absent from the file system; removing  the
  1324.     file that it points to does not affect or alter the symbolic
  1325.     link itself.
  1326.  
  1327.     NOTE: Symbolic links (also known as "soft links") are
  1328.           currently NOT SUPPORTED by AmigaOS.  DO NOT USE!
  1329.  
  1330.     LOCAL
  1331.     Usage: local [var...var]
  1332.  
  1333.     Creates one or more local variables. Those variables disappear
  1334.     at the end of their alias or source file, and cannot be accessed
  1335.     from inside other aliases or source files.
  1336.     With no arguments, shows all top level variables and their values.
  1337.  
  1338.     LS
  1339.     Equivalent to dir.
  1340.  
  1341.     MAKELINK
  1342.     Equivalent to ln.
  1343.  
  1344.     MAN
  1345.     Usage    : man command(s)
  1346.     Example    : man mkdir
  1347.  
  1348.     Get  info about a Shell command, or others keywords.  These include
  1349.     all  special  _variables, plus various keywords:  WILDCARDS, PIPES,
  1350.     EDITING, STARTUP and more.
  1351.     See special alias manlist to get a list of ALL keywords supported
  1352.     by man.
  1353.     You  must set _man to the paths of your .doc files:
  1354.        set _man dh1:docs/aliases.doc dh1:docs/csh.doc
  1355.  
  1356.     To create your own .doc files, precede all your keywords by four
  1357.     blanks. 'man' will then display lines until the first character
  1358.     of a line is alphanumeric or has four leading blanks.
  1359.  
  1360.     MD
  1361.     Equivalent to mkdir.
  1362.  
  1363.     MEM
  1364.     Usage    : mem [-cfqu]
  1365.  
  1366.     Options:
  1367.       -c shows the free chip mem only
  1368.       -f shows the free fast mem only
  1369.       -q outputs just a number without titles
  1370.       -s stores current free memory
  1371.       -r shows memory used relative to last stored
  1372.       -l flushes all unneeded memory
  1373.  
  1374.     MENU
  1375.     Usage    : menu [-mn] [ title item...item ]
  1376.     Example    : menu Shell   JrComm,,j   Rename,"rename ",r  quit
  1377.  
  1378.     Appends one pull down in the current console window. Up to 31
  1379.     menus with 63 items each (including title) can be installed.
  1380.  
  1381.     If the item is just a string, that string will be in the menu item.
  1382.     When you select it, it will be put into the prompt and executed.
  1383.  
  1384.     If there is a comma and after that comma a second string, this
  1385.     will be the command will be inserted at the prompt. This time you
  1386.     have to add the ^M yourself if you want the command to be executed.
  1387.  
  1388.     If there is a second comma, the letter after that comma will be
  1389.     the keyboard shortcut for that menu item. (This will be case
  1390.     sensitive some day, use lowercase).
  1391.  
  1392.     If for any reason your current menu is corrupt, just enter an
  1393.     empty 'menu' command.
  1394.  
  1395.     To clear all existing menus use option -n.
  1396.  
  1397.     When the first menu is installed you can use option -m to choose
  1398.     a monospaced font (System Default Font) instead of the default
  1399.     Intuition Font (which may be a proportional font). This is useful
  1400.     for user-formatted menus (like in the example script "menu.sh").
  1401.  
  1402.     MKDIR
  1403.     Usage    : mkdir [-p] name name name...
  1404.     Example    : mkdir df0:stuff
  1405.  
  1406.     Create the specified directories.
  1407.  
  1408.     mkdir now supports the -p option.  mkdir -p followed by a full path
  1409.     name will create all directories necessary to make the path.  For
  1410.     example, suppose that the directory ram:foo exists and is empty.
  1411.     "mkdir -p ram:foo/bar/tst/a" would create ram:foo/bar,
  1412.     ram:foo/bar/tst, and ram:foo/bar/tst/a all in one step.
  1413.     In addition, it will issue no error codes for directories it cannot
  1414.     make.
  1415.  
  1416.     MV
  1417.     Equivalent to rename.
  1418.  
  1419.     OPEN
  1420.     Usage    : open filename filemode filenumber
  1421.     Example    : open RAM:data w 1
  1422.  
  1423.     This  allows you to open a file, redirect to it as many commands as
  1424.     you like, then close it.
  1425.     Filename is any valid AmigaDOS filename, filemode is either "r" for
  1426.     read or "w" for write, filenumber is a number between 1 and 10.
  1427.     To  redirect  a  program to or from an open file, use as your redir
  1428.     filename a dot followed by the filenumber.
  1429.     Here is a complete example:
  1430.  
  1431.         open RAM:data w 1
  1432.         echo -n 2+2= >.1
  1433.         rpn 2 2 + . CR >.1
  1434.         close 1
  1435.         type RAM:data    # will display 2+2=4
  1436.  
  1437.     See also close, flist.
  1438.  
  1439.     PATH
  1440.     Usage    : path [-gr] [dir...dir]
  1441.  
  1442.     Without arguments, lists AmigaDOS path. Otherwise adds given
  1443.     directories to the path, preventing duplicate entries.
  1444.  
  1445.     Options:
  1446.      -r Resets the path
  1447.      -g Global path modifications; operations (add, reset) apply to all
  1448.          CLI processes instead of only the current one
  1449.  
  1450.     PRI
  1451.     Usage    : pri clinumber pri
  1452.     Example    : pri 3 5    # set priority of cli #3 to 5
  1453.  
  1454.     Change the priority of the specified task (use PS command to
  1455.     determine clinumber). If you specify 0 as clinumber you can
  1456.     change priority of "this" task (the one executing shell).
  1457.  
  1458.     PROTECT
  1459.     Usage    : protect file1 ... filen [+|-|=][flags]
  1460.     Example    : protect myfile +rwe
  1461.  
  1462.     Set AMIGADOS file protection flags for the file specified. Valid
  1463.     flags are h, s, p, a, r, w, e, d. x ist the same as e. Modes:
  1464.       +  Set specified bits, leave all others
  1465.       -  Clear specified bits, leave all others
  1466.       =  Set specified bits, clear all others
  1467.     Specifying no mode is equal to '='. Archive bit cleared by default.
  1468.  
  1469.     Note: This command is equivalent to "chmod" except that the
  1470.           arguments for filename(s) and flag(s) are reversed.
  1471.  
  1472.     PS
  1473.     Usage    : ps [commandname...commandname]
  1474.  
  1475.     Gives status of CLI processes.  eg:
  1476.  
  1477.     Proc Command Name         Typ  Stack  Pri.  Address  Directory
  1478.     * 1  csh                  fr   10000    0      97b0  Stuff:shell
  1479.       2  clock                bw    4096  -10    2101a8  Workdisk:
  1480.       3  emacs                bw   30000    0    212f58  Stuff:shell
  1481.       4  VT100                bw    4000    0    227328  Workdisk:
  1482.  
  1483.     Address is the address of the task, directory is the process
  1484.     currently CD'd directory. My default, only the BaseNames of
  1485.     the commands are shown. Your own CLI will be marked by an
  1486.     asterisk in the first column.
  1487.  
  1488.     Stack size is the _real_ size of a command's stack. It's _not_
  1489.     the size a program gets if it's launched by this command.  Use
  1490.     "Status" instead if you need the size of the Default Stack.
  1491.     (be aware: "Status" does _not_ show the stack size used by a prog!)
  1492.  
  1493.     Typ are two letters.  The first is either "f" (foreground) or
  1494.     "b" (background).  The second is one of:
  1495.         i: invalid
  1496.         a: added
  1497.         r: running / ready to run
  1498.         w: waiting
  1499.         e: except
  1500.         d: removed
  1501.  
  1502.     Options:
  1503.      -l shows full pathnames of commands
  1504.      -e excludes the given command names from the list
  1505.      -s don't show stacksize and type, use old output-format instead
  1506.  
  1507.     PWD
  1508.     Usage    : pwd
  1509.  
  1510.     Rebuild _cwd by backtracing from your current directory.
  1511.  
  1512.     QSORT
  1513.     Usage   : qsort [-r] <in >out
  1514.  
  1515.     Quick sorts from stdin to stdout. -r causes reverse sorting.
  1516.  
  1517.     QUIT
  1518.     Usage    : quit
  1519.  
  1520.     Quit out of Shell back to CLI.
  1521.  
  1522.     RBACK
  1523.     Usage    : rback command
  1524.  
  1525.     Start a new process executing the specified command, but can't do
  1526.     input/output. Equivalent to 'run command >NIL: <NIL:'. Instead of
  1527.     using rback, you can add a '&' at the end of the command line.
  1528.  
  1529.     Note: rback cannot start builtin commands. You have to start a
  1530.           subshell: rback csh -c "copy ram:temp prt:;rm ram:temp
  1531.  
  1532.     READFILE
  1533.     Usage    : readfile varname [filename]
  1534.  
  1535.     Completely reads an ASCII file and assigns it to a variable. Each
  1536.     line becomes one word in the resulting string. Embedded blanks
  1537.     are no problem. If file name is omitted, stdin is used. See also
  1538.     'writefile', @subfile and @flines
  1539.  
  1540.     RENAME
  1541.     Usage    : rename [-fv] from to
  1542.     or    : rename [-fv] from from from ... from todir
  1543.  
  1544.     Allows you to rename a file or move it around within a disk.
  1545.     Allows you to move 1 or more files into a single directory.
  1546.     The archive bit of the file(s) will be cleared.
  1547.  
  1548.     With -v the command is more verbose, meaning that filenames are
  1549.     displayed when they are renamed.  You can set -f to force the
  1550.     shell not to abort on errors.
  1551.  
  1552.     RESIDENT
  1553.     Usage    : resident [-r][-d] [files]
  1554.     Example    : resident lc1 lc2 blink    # load these as resident
  1555.           resident -d lc1 lc2 blink    # defer load when needed
  1556.           resident -r lc1 lc2 blink    # remove these
  1557.           resident            # list resident programs
  1558.  
  1559.     This is DOS resident. Commands are searched by Shell in resident
  1560.     list BEFORE of searching on any external device.
  1561.     Only PURE programs can run as resident, see DOS docs for more info.
  1562.     Option -d is very useful: you can say, in your startup file,
  1563.     resident -d file...file; programs will not be loaded immediately,
  1564.     but only when you will try to load them. This way, you will not
  1565.     waste memory and startup time if you don't use the programs.
  1566.     Old option -a has no more effect.
  1567.  
  1568.     RETURN
  1569.     Usage    : return [n]
  1570.     Example    : return 10
  1571.  
  1572.     Exit from a script file, or quit from shell with optional
  1573.     exit code.
  1574.  
  1575.     RM
  1576.     Equivalent to delete.
  1577.  
  1578.     RPN
  1579.     Usage    : rpn expression
  1580.     Example    : rpn 3 7 *    # Prints the value 21
  1581.  
  1582.     Evaluate an RPN expression, using 32-bit values. In older versions
  1583.     of Shell RPN contained string functions too, but now that strings
  1584.     are handled by specifical commands, these are no more needed.
  1585.     At end of evaluation, RPN prints values on stack, so you can
  1586.     say for instance "rpn $x 2 * | input x" to double the value of
  1587.     variable x.
  1588.     Functions implemented are:
  1589.  
  1590.         + - * /    Obvious meaning; / means integer division, of course
  1591.         %        Module operator e.g. "rpn 7 3 %" answers 1
  1592.         & | ~    Bitwise and, or, not operators
  1593.         > < ==    Tests for greater-than, lower-than, equal. To get
  1594.             a test for >= (or <=), you can use < ! (or > !)
  1595.         !        Logical not operator
  1596.         DUP        Duplicate value on top of stack
  1597.         DROP    Drop value on top of stack
  1598.         SWAP    Swap two values on top of stack
  1599.  
  1600.     To avoid confusion with redirections, > and < operators must be
  1601.     enclosed in quotes e.g.
  1602.  
  1603.         3 2 ">"        # Prints 1
  1604.  
  1605.     RUN
  1606.     Usage    : run prgm args
  1607.     Example    : run emacs test.c
  1608.  
  1609.     Start a new process executing the specified command. This command is
  1610.     not fully reliable: use at your own risk.  See also rback.
  1611.  
  1612.     RXREC
  1613.     Usage    : rxrec [portname]
  1614.  
  1615.     Create an AREXX-compatible port of the specified name (defaults to
  1616.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  1617.  
  1618.     CAUTION: the only way to exit from this status is to send to the
  1619.     port the message "bye".
  1620.  
  1621.     Example:
  1622.     Open two Shell's in two separate CLI's. From the first, type:
  1623.  
  1624.         rxrec
  1625.  
  1626.     Now first Shell doesn't respond to keyboard input; instead, it waits
  1627.     for messages on a port called "rexx_csh". Now, from the other, type:
  1628.  
  1629.         rxsend rexx_csh "dir df0:"
  1630.  
  1631.     You will see the listing of df0: in the first Shell.  Experiment as
  1632.     you like, then:
  1633.  
  1634.         rxsend rexx_csh bye
  1635.  
  1636.     And all will return to normal.
  1637.  
  1638.     RXSEND
  1639.     Usage    : rxsend [-lr] portname command...command
  1640.  
  1641.     Send commands to any program with an AREXX-compatible port. Be aware
  1642.     that every word is sent as a single command!
  1643.  
  1644.     You don't have to load anything to use these command (or rxrec):
  1645.     all you need is a program with the right port.
  1646.  
  1647.     An example is CygnusEdProfessional: here is, for instance, a command
  1648.     to wake it up, load the file test.c and jump to line 20:
  1649.  
  1650.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  1651.         # rexx_ced is the name of AREXX port for CygnusEd
  1652.  
  1653.     The option -r sets the variable _result to the result string
  1654.     of the AREXX command.
  1655.     The option -l send the whole line as *one* command.
  1656.  
  1657.     Refer to your application manual for details and for the names
  1658.     of the commands and the port.
  1659.  
  1660.     SEARCH
  1661.     Usage    : search [-abcefnqrvw] file...file string
  1662.  
  1663.     Search specified files for a string. Only lines containing the
  1664.     specified strings are displayed.
  1665.  
  1666.     If the filename is STDIN (in uppercase), the standard input is
  1667.     used, so you can use search as the destination for a pipe.
  1668.     Example:
  1669.         strings myprog * | search STDIN .library
  1670.     Lists all libraries used in "myprog".
  1671.  
  1672.     Search is very fast if none of the options -w, -e and STDIN was
  1673.     specified and the file fits into memory.
  1674.  
  1675.     Options:
  1676.       -a (abort)   stops search as soon as the pattern was found once
  1677.       -b (binary)  shows only byte offsets instead of lines. If combined
  1678.                    with -n, shows naked numbers.
  1679.       -c (case)    turns ON case sensitivity
  1680.       -e (exclude) lists lines NOT containing the pattern
  1681.       -f (files)   causes only the names of the files in which the pat-
  1682.                    tern was found to be displayed.
  1683.       -l (left)    pattern must be at beginning of line (this is faster
  1684.                    than using a wild card)
  1685.       -n (number)  turns off line numbering
  1686.       -o (only)    finds only whole words
  1687.       -q (quiet)   suppresses printing of file names.
  1688.       -r (recurse) if you specify any directory, all files in that di-
  1689.                    rectory are recursively searched.
  1690.       -v (verbose) shows each file name on a single line. this is auto-
  1691.                    matically turned on if search is redirected
  1692.       -w (wild)    wild card matching. see notes below
  1693.  
  1694.     Notes to wild card matching;
  1695.     - Uses Shell standard matching.
  1696.     - All standard DOS wildcards are allowed * ? [] () | ~ ' #
  1697.     - The WHOLE line must match the string, not only a substring.
  1698.     - String MUST be enclosed in quotes to avoid wildcard expansion
  1699.  
  1700.     Examples:
  1701.         search -cr df0:include ACCESS
  1702.     Find all occurrences of ACCESS (in uppercase) in all files
  1703.     contained in include directory.
  1704.         search -w shell.h "'#define*"
  1705.     Lists only lines of file beginning with (not simply containing)
  1706.     #define. Note the use of ' to escape the special symbol #.
  1707.  
  1708.     SET
  1709.     Usage    : set [name] [=] [string]
  1710.     Example    : set abc hello
  1711.  
  1712.     Set with no args lists all current variable settings.
  1713.     Set with one arg lists the setting for that particular variable.
  1714.     Specifying name and string, stores the string into variable name.
  1715.  
  1716.     Also see the section on special _variables.
  1717.  
  1718.     SETENV
  1719.     Usage    : setenv envvar value
  1720.  
  1721.     Sets an ENV: variable to the given value. The value must be
  1722.     enclosed in quotes if it contains spaces. To retrieve an ENV:
  1723.     variable, just use $envvar anywhere on a command line.
  1724.  
  1725.     SLEEP
  1726.     Usage    : sleep timeout
  1727.     Example    : sleep 10
  1728.  
  1729.     Sleep for 'timeout' seconds, or until ^C typed.
  1730.  
  1731.     SPLIT
  1732.     Usage    : split srcvar dstvar...dstvar
  1733.  
  1734.     Assigns one word of srcvar to every dstvar, the rest of srcvar to
  1735.     the last dstvar.
  1736.     Note: You enter variable NAMES, not variables.
  1737.  
  1738.     STACK
  1739.     Usage    : stack [number]
  1740.     Example    : stack [-s] 8000
  1741.  
  1742.     Changes the default stack for this CLI.
  1743.     Without arguments, prints it; or with option -s prints size only
  1744.     (pure number, no text).
  1745.  
  1746.     STRHEAD
  1747.     Usage    : strhead varname breakchar string
  1748.     Example    : strhead x . foobar.bas    # Will set x to "foobar"
  1749.  
  1750.     Remove everything after and including the breakchar in 'string' and
  1751.     place in variable 'varname'.
  1752.  
  1753.     STRINGS
  1754.     Usage    : strings [file1..fileN] [minlength]
  1755.     Example    : strings c:dir c:list shell 7
  1756.     Options :
  1757.      -r  if you specify any directory, all files in that directory
  1758.          are recursively searched for strings
  1759.      -b  shows strings in bounds
  1760.          (slightly changed output format)
  1761.  
  1762.     Prints strings contained in specified files (usually binary)
  1763.     with length >= minlength.  Default is 4.
  1764.  
  1765.     You cannot use a filename that represents a number as last
  1766.     argument. If there are no filenames specified, standard input
  1767.     is used, so you can use strings as the destination for a pipe.
  1768.  
  1769.     STRLEFT
  1770.     Usage    : strleft varname string n
  1771.     Example    : strleft x LongString 5    # Will set x to "LongS"
  1772.  
  1773.     Place leftmost n chars of string in variable varname.
  1774.  
  1775.     STRLEN
  1776.     Usage    : strlen varname string
  1777.     Example    : strlen x Hello        # Will set x to "5"
  1778.  
  1779.     Puts len of string in variable varname.
  1780.  
  1781.     STRMID
  1782.     Usage    : strmid varname string n1 [n2]
  1783.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  1784.  
  1785.     Places n2 chars from string, starting at n1, in variable varname.
  1786.     By omitting n2, you get all chars from n1 to end of string.
  1787.  
  1788.     STRRIGHT
  1789.     Usage    : strright varname string n
  1790.     Example    : strright x LongString 5    # Will set x to "tring"
  1791.  
  1792.     Place rightmost n chars of string in variable varname.
  1793.  
  1794.     STRTAIL
  1795.     Usage    : strtail varname breakchar string
  1796.     Example    : strtail x . foobar.bas    # Will set x to "bas"
  1797.  
  1798.     Remove everything before and including the breakchar in 'string' and
  1799.     place in variable 'varname'.
  1800.  
  1801.     SOURCE
  1802.     Usage    : source file [arguments]
  1803.     Example    : source mymake.sh all
  1804.     Result    : batch file 'mymake.sh' called with var _passed = 'all'
  1805.  
  1806.     Execute commands from a file.  You can create SHELL programs in
  1807.     a file and then execute them with this command.  Source'd files
  1808.     have the added advantage that you can have loops in your command
  1809.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  1810.     by specifying arguments after the file name.  Arguments are passed
  1811.     via the _passed variable (as a single string, a set of words).
  1812.     See _failat variable for script aborting.
  1813.  
  1814.     Long lines may be split by appending a backslash (\) at end of
  1815.     first part. One single line must be shorter than 512 bytes, but
  1816.     the concatenated line can be as long as you want. There is no
  1817.     limit on the length of the concatenated line.
  1818.  
  1819.     Automatic 'sourcing' is accomplished by appending a .sh suffix to
  1820.     the file (no need to set the s-bit) and executing it as you would
  1821.     a C program:
  1822.  
  1823.     --------- file hello.sh ---------
  1824.     foreach i ( $_passed ) "echo yo $i"
  1825.     ---------------------------------
  1826.  
  1827.     $ hello a b c
  1828.     yo a
  1829.     yo b
  1830.     yo c
  1831.  
  1832.     If the last character of a line in a source file is '{', all
  1833.     following lines will appended to the current one and separated
  1834.     by semicolons until the last character of a line is '}'. Those
  1835.     blocks may be nested. You may use comments and unterminated
  1836.     strings within.
  1837.  
  1838.     --------- file login.sh ---------
  1839.     alias complex {
  1840.       echo -n "this alias
  1841.       echo " works!"
  1842.     }
  1843.     ---------------------------------
  1844.  
  1845.     $ login
  1846.     $ complex
  1847.     this   alias   works!
  1848.  
  1849.  
  1850.     TACKON
  1851.     Usage    : tackon var pathname filename
  1852.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  1853.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  1854.  
  1855.     Correctly  adds  a  filename  to a pathname, and puts the result in
  1856.     variable specified.
  1857.  
  1858.     TAIL
  1859.     Usage    : tail [filename] [num]
  1860.     Example    : tail readme 20
  1861.  
  1862.     Display last "num" lines of "filename".    If num is not specified,
  1863.     10 is assumed. If filename is not specified, standard input (stdin)
  1864.     is taken instead.
  1865.  
  1866.     TEE
  1867.     Usage    : tee [file]
  1868.     Example    : cc test.c | tee >error.list
  1869.  
  1870.     Copies stdin to stdout and the given file.
  1871.     If file is omitted, stderr is used.
  1872.  
  1873.     TOUCH
  1874.     Usage    : touch file1 .. fileN
  1875.  
  1876.     Sets DateStamp of the specified files to the current date & resets
  1877.     archive bit.
  1878.  
  1879.     If a file doesn't exist, touch will create an empty one for you.
  1880.  
  1881.     TRUNCATE
  1882.     Usage    : truncate [n]
  1883.     Example : alias | qsort | truncate
  1884.  
  1885.     A filter that truncates the width of stdin to the specified number,
  1886.     trying to account for tab's and escape sequences. If the number is
  1887.     omitted, the current window width is used.
  1888.  
  1889.     TYPE
  1890.     Equivalent to CAT.
  1891.  
  1892.     UNALIAS
  1893.     Usage    : unalias name .. name
  1894.     Example    : unalias vt
  1895.  
  1896.     Delete aliases..
  1897.  
  1898.     UNIQ
  1899.     Usage    : uniq
  1900.  
  1901.     This is a  filter that removes consecutive, duplicated lines in a
  1902.     file.  It is most useful on a sorted file.
  1903.  
  1904.     UNSET
  1905.     Usage    : unset name .. name
  1906.     Example    : unset abc
  1907.  
  1908.     Unset one or more variables.  Deletes them entirely.
  1909.  
  1910.     USAGE
  1911.     Usage    : usage [command...command]
  1912.  
  1913.     If called without arguments, usage gives you a short information
  1914.     on the special characters used. Otherwise, usage shows you the
  1915.     usage of the given commands. Calling a command with a '?' as
  1916.     the only argument will show its usage, too.
  1917.  
  1918.     VERSION
  1919.     Usage    : version
  1920.  
  1921.     Show current version name, & authors.
  1922.  
  1923.     WAITFORPORT
  1924.     Usage    : waitforport portname [seconds]
  1925.     Example    : waitforport rexx_ced 5
  1926.  
  1927.     Waits for a port to come up. Default time is 10 seconds.
  1928.  
  1929.     WHEREIS
  1930.     Usage    : whereis [-r] filename [ device1...deviceN ]
  1931.  
  1932.     If just a file name is given, whereis searches all subdirectories of
  1933.     the current directory for that file. An asterisk '*' is appended to
  1934.     the file. Wild cards are allowed for the file (no asterisk will be
  1935.     appended then), but no path names. If additional arguments are
  1936.     given, whereis searches only these paths, not the current directory.
  1937.     whereis -r looks on all drives.
  1938.  
  1939.     WINDOW
  1940.     Usage    : window [-q][-f][-b][-l][-s] [dimensions]
  1941.     Options    :
  1942.         -f    (front) Window to front
  1943.         -b    (back)  Window to back
  1944.         -l    (large) Window to maximum size
  1945.         -s    (small) Window to minimum size
  1946.         -a    (activate)
  1947.         -q    (query) Lists screens and windows open
  1948.  
  1949.        Various  operations on CLI window.  If dimensions are specified,
  1950.     they must be in the form x y width height, with values separated by
  1951.     spaces.
  1952.        The  command  "window  -l" may be very useful on PAL machines to
  1953.     get  a  full  PAL  window  from  your login sequence, or if you use
  1954.     overscan WorkBench.
  1955.        Option  -q  gives,  for  each  Screen and Window currently open,
  1956.     title, left edge, top edge, width, height, (depth).
  1957.  
  1958.     WRITEFILE
  1959.     Usage: writefile varname
  1960.  
  1961.     Writes a set of words to stdout, one word per line. Note that the
  1962.     name of the variable (var) must be supplied, not the value ($var).
  1963.  
  1964.  
  1965. IX. SPECIAL VARIABLES
  1966. ---------------------
  1967.  
  1968. There are a number variables, the write variable, that have a side effect on
  1969. your system (e.g.  changing the title bar), and some others, the read
  1970. variables, that tell you something about your environment (e.g.  the current
  1971. shell version).  You can also overlay the write variables with a local
  1972. variable, so any change only takes place while the current context is
  1973. valid.
  1974.  
  1975. LIST OF VARIABLES:
  1976. ------------------
  1977.  
  1978.     _abbrev
  1979.     If set to 'n', internal commands can no longer be abbreviated.
  1980.  
  1981.     _bground
  1982.     True if the shell was started with a non-interactive input.
  1983.  
  1984.     _clinumber
  1985.     Contains the number (1-20) of current CLI.
  1986.  
  1987.     _clipri
  1988.     Task priority while editing command line.
  1989.     (also affects filename completion)
  1990.  
  1991.     _cwd
  1992.     Holds a string representing the current directory we are in from
  1993.     root.  The SHELL can get confused as to its current directory if
  1994.     some external program changes the directory.  Use PWD to rebuild
  1995.     the _cwd variable in these cases.
  1996.  
  1997.     _debug
  1998.     Debug mode... use it if you dare.  must be set to some value
  1999.  
  2000.     _dirformat
  2001.     Holds a format string that (if this variable is set) substitutes
  2002.     the format string of the "dir" command (option -z, see there).
  2003.     Used to keep aliases short and to be able to specify other options
  2004.     after the format option (-z) without using @pickargs/@pickopts.
  2005.  
  2006.     _every
  2007.     Contains the name of a command that is to be executed every time
  2008.     just before the prompt is printed. Do not use this to echo the
  2009.     prompt.
  2010.  
  2011.     _except
  2012.     See EXCEPTION
  2013.  
  2014.     _failat
  2015.     If a command returns with an error code higher than this, the
  2016.     batch file aborts. The default is 20.
  2017.  
  2018.     _hilite
  2019.     Holds the font attributes used for highlighting. One letter for one
  2020.     attribute:
  2021.       b    for bold
  2022.       i    for italic
  2023.       u    for underlined
  2024.       r    for reverse
  2025.       c3   for foreground color 3
  2026.       c3,2 for foreground color 3 and background color 2
  2027.     Any combinations are allowed. _hilite defaults to "c7", in terminal
  2028.     mode to "r".
  2029.  
  2030.     _history
  2031.     This variable is set to a numerical value, and specifies how far
  2032.     back your history should extend. Set it to 0 to disable history,
  2033.     for example if you test your programs for memory leaks. Defaults
  2034.     to 50.
  2035.  
  2036.     _insert
  2037.     Sets the default for insert/overtype mode for command line editing.
  2038.     ESC-i toggles between, but after <RET> the default is set back as
  2039.     indicated by this variable. By default _insert is 1, unsetting
  2040.     _insert will make overtype the default.
  2041.  
  2042.     _ioerr
  2043.     Contains the secondary error code for the last command. Will be
  2044.     changed after every external command and after a failed internal
  2045.     command. See @ioerr( )
  2046.  
  2047.     _kick2x
  2048.     True if exec.library V37+ could be opened
  2049.     (which means that kickstart 2.0 is around)
  2050.  
  2051.     _kick3x
  2052.     True if exec.library V39+ could be opened
  2053.     (which means that kickstart 3.0 is around)
  2054.  
  2055.     _lasterr
  2056.     Return code of last command executed.  This includes internal
  2057.     commands as well as external comands, so to use this variables
  2058.     you must check it IMMEDIATELY after the command in question.
  2059.  
  2060.     _lcd
  2061.     Holds the name of the last directory. The builtin alias 'dswap'
  2062.     cd's to that directory. If called again, you're back where you
  2063.     were.
  2064.  
  2065.     _man
  2066.     The path and name of your .doc files. Defaults to 'csh:csh.doc'
  2067.  
  2068.     _maxerr
  2069.     The worst (highest) return value to date.  To use this, you usually
  2070.     set it to '0', then do some set of commands, then check it.
  2071.  
  2072.     _minrows
  2073.     Gives the minimum number of rows a window must have to turn on quick
  2074.     scrolling. Defaults to 34.
  2075.  
  2076.     _nobreak
  2077.     If set to some value, disables CTRL-C.
  2078.  
  2079.     _nomatch
  2080.     If set to some value, check pattern if it matches anything
  2081.     (and abort command execution if pattern does not match).
  2082.  
  2083.     _noreq
  2084.     If set to some value, disables system requesters ("Please insert
  2085.     volume ...."). Turned on in vt200 mode.
  2086.  
  2087.     _passed
  2088.     This variable contains the passed arguments when you SOURCE a file
  2089.     or execute a .sh file.  For instance:
  2090.  
  2091.     test a b c d
  2092.  
  2093.     -------- file test.sh ----------
  2094.     echo $_passed
  2095.     foreach i ( $_passed ) "echo YO $i"
  2096.     --------------------------------
  2097.  
  2098.     _path
  2099.     Tells CShell where to look for executable files. The current direc-
  2100.     tory and the AmigaDOS path will be searched first. The trailing
  2101.     slash for directories is not necessary anymore.  The entire path
  2102.     will be searched first for the <command>, then for <command>.sh
  2103.     (automatic shell script sourcing). Example:
  2104.         set _path ram:c,ram:,sys:system,dh1:tools,df0:c
  2105.     (This path has the advantage that these directories need not even
  2106.      exist, that you can access devices (AmigaDOS path only knows
  2107.      volumes under Kick 1.3) and that no disk seeks happen at startup)
  2108.  
  2109.     _prompt
  2110.     This variable now can contain the following control characters:
  2111.      %c  for color change. This highlights your prompt. See _hilite
  2112.      %e  for elapsed time. The time the last command took to execute.
  2113.      %m  for memory. This shows your current memory in K
  2114.      %t  for time. This shows your current time in the format HH:MM:SS
  2115.      %d  for date. This shows the current date in the format DD-MMM-YY
  2116.      %p  for path. This inserts the current path
  2117.      %V  for volume. This inserts the current volume
  2118.      %n  for number. This inserts the current process number
  2119.      %v  for version. This shows the version number of CShell
  2120.      %h  for history. This displays the current history number
  2121.      %f  for free store. This shows the free store on the current drive
  2122.      %r  for pRiority. Inserts the task priority of the current
  2123.      %s  for shells open. Inserts the result of 'howmany'
  2124.      %x  for external cmd return code. Yields the last error code
  2125.     The default for prompt is now "%c%p> "
  2126.     The  if  command  will  set the prompt to a '_ ' if commands are
  2127.     disabled while waiting for a 'endif' or 'else' command (interactive
  2128.     mode only).
  2129.  
  2130.     _pipe
  2131.     The directory where temporaries are stored. Default: 'T:'
  2132.  
  2133.     _qcd
  2134.     Holds the name of the file where the all directories on your hard
  2135.     disk are stored. If not set, disables quick cd-ing.
  2136.  
  2137.     _rback
  2138.     Is the name of the command to be the prepended to the command line
  2139.     when '&' was added to it. Defaults to 'rback', can't be a multi
  2140.     word command yet.
  2141.  
  2142.     _rxpath
  2143.     The same as with _path, but this is where CShell looks for .rexx
  2144.     files. Defaults to REXX:
  2145.  
  2146.     _scroll
  2147.     Holds the number of lines to be scrolled at once when quick
  2148.     scrolling is used. If unset or <=1, quick scrolling is off.
  2149.     Defaults to 3.
  2150.  
  2151.     _terminal
  2152.     Indicates whether or not shell was started in terminal mode.
  2153.  
  2154.     _titlebar
  2155.     The same control characters as for the _prompt can be used for
  2156.     _titlebar, too. The only difference is that %c is ignored. The
  2157.     titlebar is updated every time before the prompt appears.
  2158.  
  2159.     _verbose
  2160.     If set to 's', turns on verbose mode for source files (every command
  2161.     will be displayed before being executed). If set to 'a', displays
  2162.     all substeps while alias substitution. 'h' will hilight the debug
  2163.     output. Any combination allowed: set _verbose sah
  2164.  
  2165.     _version
  2166.     Contains the version number of the shell, e.g. 510.
  2167.  
  2168.  
  2169. X.   FUNCTIONS
  2170. --------------
  2171.  
  2172.     FUNCTIONS
  2173.     Functions are preceded by an @-sign and may not be abbreviated
  2174.     They must be preceded by a blank and a blank must follow the opening
  2175.     and precede the closing parenthesis. There must be no blank between
  2176.     the function name an the opening parenthesis. Example:
  2177.        echo @info( df0: )
  2178.     (NOTE: Later versions of Shell might allow that functions need not
  2179.            be at the beginning of an argument, so quote any @-signs not
  2180.            used for functions)
  2181.  
  2182.     Functions may be nested. The function names themselves are case
  2183.     sensitive, but the operations (like strcmp) aren't.
  2184.  
  2185.     Functions can be used as commands. They will echo their return value
  2186.     to stdout. Note that they can't be abbreviated and that the function
  2187.     list is searched after the command list. Example:
  2188.         drives          ---> DF0: DH1: DH2: RAM: WB_2.x:
  2189.     Therefore, functions can also be used like this:
  2190.         echo $(drives)
  2191.  
  2192.     So far, functions are not user definable.
  2193.  
  2194.     Note the difference between sets of words and strings. After
  2195.       set var hello world
  2196.     $var is a wordset, but after
  2197.       set var "hello world"
  2198.     var is one string. Although they look the same if echoed, they
  2199.     behave different, for example in 'foreach i ( var ) "echo hi'. The
  2200.     functions @split and @concat convert the two forms.
  2201.  
  2202.  
  2203. LIST OF FUNCTIONS:
  2204. ------------------
  2205.  
  2206.     @abbrev( str1 str2 [len] )
  2207.     true if the first <len> chars of str1 are an abbreviation of str2
  2208.     @abs( num )
  2209.     returns absolute value of <num>
  2210.     @age( file )
  2211.     the age of that file in days, 99999 if file not found
  2212.     @appsuff( name suffix )
  2213.     appends an suffix ( .ZOO ) to a string if it's not already there
  2214.     @arg( arg ... arg )
  2215.     see @pickargs( )
  2216.     @ask( title item ... item )
  2217.     asks for confirmation of every item and returns the confirmed ones
  2218.     (very similar to @confirm(), but default is negative)
  2219.     @availmem( [type] )
  2220.     returns free 'chip', 'fast' or otherwise total memory
  2221.     @basename( path ... path )
  2222.     returns the file name parts of the paths
  2223.     @center( word len )
  2224.     returns a string of length <len> with <word> centered in it
  2225.     @checkport( portname )
  2226.     indicates if given port exists
  2227.     @clinum( procname )
  2228.     returns the number of the cli identified by a name or a number
  2229.     @complete( abbrev word ... word )
  2230.     returns the first word <abbrev> is an abbreviation of
  2231.     @concat( word word ... word )
  2232.     concats all words in one blank separated string, see @split
  2233.     @confirm( title item ... item )
  2234.     asks for confirmation of every item and returns the confirmed ones
  2235.     (very similar to @ask(), but default is positive)
  2236.     @console( STDIN|STDOUT )
  2237.     tells whether stdin or stdout are interactive (not redirected)
  2238.     @dectohex( number )
  2239.     returns a string representing <number> in hex
  2240.     @delword( word word ... word n )
  2241.     returns a string with the n-th word deleted.
  2242.     @delwords( word word ... word n m )
  2243.     deletes the next m words from the n-th.
  2244.     @dirname( path )
  2245.     strips the base name from a path, just returns the directory
  2246.     @dirs( name name name name )
  2247.     returns the directories among the given file names, see @files
  2248.     @dirstr( lformat file )
  2249.     returns any info (size, date, file comment) about a file
  2250.     @drive( path )
  2251.     outputs the drive ( device ) name associated to <path>
  2252.     @drives( )
  2253.     outputs all available drives
  2254.     @exists( file )
  2255.     tells whether a file exists or not
  2256.     @fileblks( file file ... file )
  2257.     returns the # of blocks needed for the files, incl. dir blocks
  2258.     @filedate( file )
  2259.     returns a string representing the date of the given file
  2260.     @fileinfo
  2261.     Equivalent to @dirstr
  2262.     @filelen( file file ... file )
  2263.     count the total number of bytes of the given files
  2264.     @filenote( file )
  2265.     returns filenote of given file
  2266.     @fileprot( file )
  2267.     returns a string like ---arwed
  2268.     @filereq( title path&pattern filename )
  2269.     brings up the ASL file requester and returns the selected file name
  2270.     @files( file file ... file )
  2271.     gives you the files among those names, no directories. see @dirs
  2272.     @filesize
  2273.     Equivalent to @filelen
  2274.     @flines( varname )
  2275.     counts the number of lines in a readfile-file (faster than @words)
  2276.     @freebytes( path )
  2277.     the number of free bytes on the given path
  2278.     @freeblks( path )
  2279.     the number of free blocks on the given path
  2280.     @freestore( path )
  2281.     the amount of free store on that path, given in K, M and G
  2282.     @getenv( varname )
  2283.     returns the value of the named env: variable
  2284.     @getclass( file )
  2285.     returns the class (type) of the file. See chapter XIV
  2286.     @hextodec( hex-number )
  2287.     returns a string representing <hex-number> in dec
  2288.     @howmany( )
  2289.     indicates the # of shells running
  2290.     @index( string pattern )
  2291.     returns the index of pattern in string (starting at 1),
  2292.     0 if not found
  2293.     @info( path )
  2294.     the corresponding line from the 'info' command, each entry a word
  2295.     @intersect( word1 word2 word3 , word4 word5 word6 )
  2296.     returns all words which are in both lists. see @union, @member
  2297.     @ioerr( num )
  2298.     returns the corresponding error string to num
  2299.     @lookfor( file paths )
  2300.     looks for a file in the current directory and the paths. See $_path
  2301.     @lower
  2302.     lowercases its arguments. see @upper
  2303.     @match( word ... word "pattern" )
  2304.     returns the words in the list that match the DOS-pattern
  2305.     @max( num num ... num )
  2306.     computes the maximum of all given numbers
  2307.     @megs( number )
  2308.     expresses a number in K, M and G (-bytes), rounded correctly
  2309.     @member( word1 word word ... word )
  2310.     tells you if word1 is among the remaining words
  2311.     @min( num num ... num )
  2312.     computes the minimum of all given numbers
  2313.     @mix( arg1 ... argn )
  2314.     randomly mixes its arguments
  2315.     @mounted( device )
  2316.     returns a boolean indicating whether the specified device is mounted
  2317.     @nameext( filename )
  2318.     returns all after the last dot of <filename>.
  2319.     @nameroot( filename )
  2320.     returns all before the LAST dot of <filename>.
  2321.     @opt( arg ... arg )
  2322.     see @pickopts( )
  2323.     @pathname( path )
  2324.     obsolete. use @dirname
  2325.     @pickargs( arg ... arg )
  2326.     picks of its arguments those which don't start with a '-'
  2327.     @pickopts( arg ... arg )
  2328.     picks of its arguments those which start which a '-'
  2329.     @rnd( )
  2330.     returns a 32 bit random number
  2331.     @rpn( expression )
  2332.     computes the rpn expression. See rpn command
  2333.     @scrheight( )
  2334.     outputs the current height of the screen the shell is running in
  2335.     @scrwidth( )
  2336.     outputs the current width of the screen the shell is running in
  2337.     @sortargs( name ... name )
  2338.     sorts its arguments alphabetically
  2339.     @sortnum( number ... number )
  2340.     sorts its arguments numerically
  2341.     @split( string )
  2342.     makes each blank separated part of @string a word, see @concat
  2343.     @strcmp( name name )
  2344.     returns -1, 0 or 1 depending of alphabetical comparison
  2345.     (case-sensitive)
  2346.     @stricmp( name name )
  2347.     returns -1, 0 or 1 depending of alphabetical comparison
  2348.     (case-insensitive)
  2349.     @strhead( breakchar string )
  2350.     see strhead command
  2351.     @strleft( string number )
  2352.     see strleft command
  2353.     @strmid( string n1 n2 )
  2354.     see strmid command
  2355.     @strright( string n )
  2356.     see strright command
  2357.     @strtail( breakchar string )
  2358.     see strtail command
  2359.     @subfile( varname n m )
  2360.     like @subwords, but acts on a readfile-file and is faster
  2361.     @subwords( word ... word n m )
  2362.     returns the next m words word of the given list starting from n
  2363.     @tackon( path file )
  2364.     see tackon command
  2365.     @trim( word word word )
  2366.     removes all leading and trailing blanks from the words
  2367.     @unique( word ... word )
  2368.     sorts the arguments and makes each of them unique
  2369.     @union( name ... name , name ... name )
  2370.     returns all names that are in either list. See @intersect, @member
  2371.     @upper( word ... word )
  2372.     upper cases the given words. see @lower
  2373.     @volume( path )
  2374.     returns the volume name in that path or ""
  2375.     @wincols( )
  2376.     returns the number of columns in the current shell window
  2377.     @winheight( )
  2378.     outputs the height of your window in pixels
  2379.     @winleft( )
  2380.     returns the left edge of your window
  2381.     @winrows( )
  2382.     returns the number of lines in the current shell window
  2383.     @wintop( )
  2384.     returns the top edge of your window
  2385.     @winwidth( )
  2386.     outputs the width of your window in pixels
  2387.     @without( name ... name , name ... name )
  2388.     returns all names of list 1 that are not in list 2
  2389.     @word( name ... name n )
  2390.     picks the n-th word from the list.
  2391.     @words( name ... name )
  2392.     returns the number of words in the list.
  2393.  
  2394.  
  2395. XI. MISCELLANEOUS
  2396. -----------------
  2397.  
  2398.     CShell now allows to do quick scrolling in large windows. Quick
  2399.     scrolling means that whenever the cursor reaches the bottom of
  2400.     the window, the text jumps up 3 or more lines at once. However,
  2401.     only the following commands support this:
  2402.         dir, cat, htype, strings, search, truncate, tee
  2403.     You can choose the number of lines to scroll at once by setting
  2404.     the variable _scroll. Unsetting it or setting it to a value <=1
  2405.     completely disables quick scrolling.
  2406.     You can also choose the number lines a window must at least have
  2407.     to turn on the quick scrolling by setting the _minrows variable.
  2408.     (Defaults to 34). Quick scrolling is automatically disabled when
  2409.     the command is redirected. By piping any command to cat, you can
  2410.     force it to quick scroll. Example:  List | cat
  2411.  
  2412.     CShell now can be terminated using the closing gadget in the
  2413.     AmigaDOS 2.0 shell window. Don't execute c:ENDCLI while using
  2414.     the shell. This can cause problems with external commands. The
  2415.     closing button provides a 'quit' command. You can define
  2416.       alias quit "Endcli;\\quit
  2417.     to assert that the CLI window closes when you click the button.
  2418.  
  2419.  
  2420.     EXCEPTIONS
  2421.     If  no  _except variable exists, any command which fails causes the
  2422.     rest of the line to abort as if an ABORTLINE had been executed.  If
  2423.     the _except variable exists, it is of the form:
  2424.  
  2425.     "nnn;commands..."
  2426.  
  2427.     where  nnn  is  some  value  representing  the  minimum return code
  2428.     required  to  cause  an  error.   Whenever a command returns a code
  2429.     which  is  larger  or  equal  to  nnn,  the commands in _except are
  2430.     executed  before  anything.   WHEN _except EXISTS, THE COMMAND LINE
  2431.     DOES  NOT  ABORT AUTOMATICALLY.  Thus, if you want the current line
  2432.     being executed to be aborted, the last command in _except should be
  2433.     an "abortline".
  2434.  
  2435.     Exception  handling  is  disabled  while  in the exception handling
  2436.     routine (thus you can't get into any infinite loops this way).
  2437.  
  2438.     Thus if _except = ";", return codes are completely ignored.
  2439.  
  2440.     Example:
  2441.  
  2442.     set _except "20;abortline"
  2443.  
  2444.  
  2445. XII. EXAMPLE SOURCE FILES
  2446. -------------------------
  2447.  
  2448. If from a CLI or the startup-script you say 'SHELL filename', that file is
  2449. sourced first.
  2450.  
  2451. ### compat.sh ###
  2452.  
  2453. # this makes sure that your old abbreviations don't call new commands
  2454.  
  2455. alias as  aset
  2456. alias cl  close
  2457. alias g   goto
  2458. alias h   help
  2459. alias he  help
  2460. alias m   md
  2461. alias q   quit
  2462. alias re  rename
  2463. alias w   window
  2464.  
  2465. alias kr  "rm -r ram:* >NIL:
  2466.  
  2467. ### End of compat.sh ###
  2468.  
  2469.  
  2470. Moreover, if you have a file called S:.login, it will be sourced for every
  2471. Shell you run. This is useful for aliases and setting that you want in ALL
  2472. Shells.
  2473.  
  2474.  
  2475. ### Example S:.login ###
  2476.  
  2477. Here is an example .login file:
  2478.  
  2479. set F5 "cdir WORK:"^M
  2480. set f9 "ed s:login.sh"^M
  2481. set F9 "ed df0:s/startup-sequence"^M
  2482.  
  2483. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;assign $i: ram:$i
  2484. alias ramop  "md RAM:op; assign OP: ram:op
  2485. alias noop   "assign OP: ; rm -r ram:op
  2486. alias newop  "rm -r OP:*
  2487. alias dc     "dfc df0: to df1:
  2488. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh
  2489. alias get    "%q cp $q RAM: >NIL:
  2490. alias filter "%a%b%c exec $b \\<$a \\>$c
  2491.     # reads $a, filters it with $b and writes result to $c
  2492.  
  2493. alias rm     "%q \\rm @confirm( Remove $q )
  2494. # or if you want a more safe one
  2495. alias qrm    "%q \\rm @ask( Remove $q )
  2496.  
  2497. #alias rm     "%a set f @pickargs( $a );set opts @pickargs( $a );\
  2498. # e -n OK to delete @words( @files( $f ) ) file(s) and @words( @dirs( $f ) )\
  2499. # directories\"? \";input b;if $b = y;\\rm $opts $f;endif
  2500. #        # for the anxious among us: confirmed rm
  2501.  
  2502. set _prompt   "%c%p> "
  2503.     # this puts the path highlighted in the prompt
  2504.  
  2505. # this one puts cli number, free mem, date and time in title bar
  2506. set _titlebar "Shell %n    Mem %m     Date %d    Time %t
  2507.  
  2508. # This file will be sourced for every Shell you start
  2509.  
  2510. ### End of example .login ###
  2511.  
  2512. ****************************************************************************
  2513.  
  2514. If you are a CLI user, your startup-sequence may be as simple as:
  2515.  
  2516.     C:csh S:startup.sh
  2517.  
  2518. Here's a startup code:
  2519.  
  2520. ### Example S:startup.sh ###
  2521.  
  2522. wind -l    # if you are on a PAL machine, or use overscan
  2523.     # note that commands may be abbreviated (wind=window)
  2524.  
  2525. assign LC: Stuff:c  INCLUDE: Stuff:include   LIB: Boot:lib   QUAD: RAM:
  2526.  
  2527. rback C:FaccII; sleep 1
  2528.     # after spawning a process, it is always better to allow it
  2529.     # to load the command, to avoid excessive drive head movement
  2530.  
  2531. resident -d blink lc1 lc2 >NIL:    #defer loading
  2532.  
  2533. C:PopCli 300 C:Newcli         #using full pathname loads faster
  2534. C:FF -1 Siesta.font >NIL:
  2535. C:Patch_1 >NIL:
  2536. stack 8000            # lc1 and lc2 need this
  2537.  
  2538. source S:setdate.sh        # this is listed next
  2539.  
  2540. ### End of example startup.sh ###
  2541.  
  2542. ****************************************************************************
  2543.  
  2544. The following is an example source file to set date and time; it may be
  2545. used at startup if you don't have an internal clock.
  2546.  
  2547. ### setdate.sh ###
  2548.  
  2549. open CON:200/100/440/80/SetDate write 1
  2550. echo >.1 -n "Current date is "
  2551. date >.1
  2552. echo >.1 -n "Please enter date: "
  2553. input <.1 d
  2554. close 1
  2555. strlen len $d
  2556. if $len > 1 ; date $d ; endif
  2557. echo -n "New date: " ; date
  2558.  
  2559. ### End of setdate.sh ###
  2560.  
  2561. ***************************************************************************
  2562.  
  2563. Next comes a makefile that needs no Make program: may be executed from
  2564. Shell directly!!!
  2565.  
  2566. ### make.sh ###
  2567.  
  2568. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  2569. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  2570.  
  2571. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  2572.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  2573.  
  2574. # we used line continuation for better visibility. this is not necessary,
  2575. # you can type it all in one line. no more limit of 256 bytes per line
  2576.  
  2577. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  2578. set.o sub.o globals.o rawconsole.o
  2579.     ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  2580.     execom.o set.o sub.o globals.o rawconsole.o -la -lc
  2581. endif
  2582.  
  2583. ### End of make.sh ###
  2584.  
  2585.  
  2586. XIII.  Default Values
  2587. ---------------------
  2588.  
  2589. Some aliases are predefined whenever you start a new Shell. These are:
  2590.  
  2591.     CDIR
  2592.     Use "cdir directory" to clear the screen, set CD to directory,
  2593.     and list it.
  2594.  
  2595.     CLS
  2596.     Simply clear the screen.
  2597.  
  2598.     DSWAP
  2599.     Exchanges current and the previous current directory. For use in
  2600.     scripts as the symbol for last current directory may change.
  2601.  
  2602.     EXIT
  2603.     Leave Shell and exit CLI.
  2604.  
  2605.     MANLIST
  2606.     Display  a list of possible arguments to man.
  2607.  
  2608.     RX
  2609.     Executes a REXX script. Prevents unwanted starting of 'rxrec'.
  2610.  
  2611. Moreover, many variables have default values, and many function keys are
  2612. predefined. You can use set command to determine all of these.
  2613.  
  2614.  
  2615. XIV.  Object oriented features
  2616. ------------------------------
  2617.  
  2618. File classes are good for two things: Identifying files and command over-
  2619. loading. The latter means that the same command with files of different
  2620. type performs completely different actions.
  2621.  
  2622.     CLASSES OF FILES
  2623.  
  2624.     You can define a class of files using several 'class' commands.
  2625.     Here a simple example:
  2626.  
  2627.       class picture  suff=.pic suff=.iff suff=.ilbm
  2628.       class anim     suff=.anim
  2629.  
  2630.     From now on, everything with the suffix .pic, .iff or .ilbm will
  2631.     be identified as a picture. Please note that there may be no blanks
  2632.     between the names and the '=', and that blanks inside the names
  2633.     must be put in quotes. So these are the ways to identify a file:
  2634.  
  2635.       suff=.doc        True if the suffix of the file is .doc
  2636.       name=readme      True if the file is "readme"
  2637.       name="mod.*"     True if the name starts with 'mod.'
  2638.       offs=14,DC..C4FD True if the bytes starting at $14 are $DC,
  2639.                        anything, $C4, $FD  (all numbers hexadecimal!).
  2640.                        Each pair of dots means one byte ignored.
  2641.       chars            True if 90% of the bytes in the file are 32..127
  2642.                        or 9..13
  2643.       default          Always true, used to define the default type
  2644.  
  2645.     Note that only the first character is examined, so 's' = 'suff'.
  2646.     One class can be identified by more than one 'class' statement.
  2647.     They are looked at in the same sequence they were entered. So to
  2648.     make sure that an zoo archive misnamed as .lzh is identified
  2649.     correctly, use the following 'class' statements:
  2650.  
  2651.       class zoo offs=14,DCA7C4FD
  2652.       class lzh offs=2,2D6C68..2D
  2653.       class zoo suff=.zoo
  2654.       class lzh suff=.lzh
  2655.  
  2656.     Moreover, there is a builtin class 'dir', which means directory.
  2657.     Now we know many file types. But what to do with them? This is
  2658.     where we define 'actions'.
  2659.  
  2660.     ACTIONS ON CLASSES
  2661.  
  2662.     There may be one or more 'class' commands that define what actions
  2663.     need to be taken in various cases for that specific class:
  2664.  
  2665.       class zoo actions view="zoo -list" extr="zoo -extract"
  2666.       class lzh actions view="lz l"      extr="lz e"
  2667.  
  2668.     Whenever somebody tries to 'view' a test.zoo, the command
  2669.     'zoo -list test.zoo' will be issued, but if he tries to
  2670.     view test.lzh, then 'lz l test.lzh' will be executed. Note
  2671.     that any command supplied here goes through the normal csh
  2672.     parser, so AmigaDOS and csh paths will be searched. Aliases
  2673.     with arguments are allowed here, too, so whatever the user
  2674.     typed will be stored in the variable after the '%'.
  2675.  
  2676.     How do I tell a file that I want to 'view' it? There comes the
  2677.     second command used for object oriented features:
  2678.  
  2679.       action view test.zoo
  2680.  
  2681.     will first identify the type of that file and then apply, if
  2682.     possible, the 'view' action to it. Of course, this works best
  2683.     inside an alias:  alias v "action view" will define a v-command
  2684.     that views all types of files known to cshell. Similarly, you
  2685.     can define   alias xtr "action extr" and use this command to
  2686.     extract files from any type of archive.
  2687.     There is one action that will be sent to every file that you
  2688.     try to start but is not executable. This action is 'exec'.
  2689.     Assume you have defined the class 'picture', then after
  2690.  
  2691.       class picture actions view=Mostra exec=Mostra
  2692.  
  2693.     you can display a picture using Mostra by just typing its name.
  2694.     More builtin actions like 'rm' and 'dir' may be implemented,
  2695.     so don't use command names for action names.
  2696.  
  2697.     The batch file class.sh defines a few useful classes.
  2698.  
  2699.     SUPERCLASSES
  2700.  
  2701.     Assume you have a class for .c files, one for .h files, and
  2702.     one for .asm files. You might want to make the difference
  2703.     between them when identifying them, but in the end, they're
  2704.     all ASCII, aren't they? You can stat this with the command
  2705.  
  2706.       class c_source suff=.c is=ascii
  2707.  
  2708.     Now whenever an action on a file of the type c_source fails,
  2709.     the file is interpreted as of type ascii, and the same
  2710.     action is attemted again. This goes on until a class has no
  2711.     more superclass.
  2712.  
  2713.  
  2714. XV.     Keymaps
  2715. ---------------
  2716.  
  2717.     You define a keymap as a collection of key/function pairs. Both
  2718.     are given as numbers. There can be several keymaps which activate
  2719.     each other, but at first we only edit keymap 0, which is active
  2720.     at the beginning. All keys you define will eventually overwrite
  2721.     the old definitions in an existing keymap. Everything marked with
  2722.     a (*) is not yet implemented.
  2723.  
  2724.     KEYCODES
  2725.  
  2726.     1..255    The corresponding ASCII character
  2727.     256      Up Arrow
  2728.     257      Down Arrow
  2729.     258      Right Arrow
  2730.     259      Left Arrow
  2731.     260      Help
  2732.     261..270  F1..F10  (unshifted)
  2733.  
  2734.  
  2735.     Modifiers (add them to the key code)
  2736.  
  2737.     512       SHIFT (only necessary for arrows and fkeys)
  2738.     1024      ESC   (was pressed & released before this key)
  2739.  
  2740.     EDITFUNCTIONS
  2741.  
  2742.     - Movement      Move cursor...
  2743.      0  CursLeft    1 left
  2744.      1  CursRight   1 right
  2745.      2  WordLeft    1 word left
  2746.      3  WordRight   1 word right
  2747.      4  BegOfLine   to beginning of line
  2748.      5  EndOfLine   to end of line
  2749.  
  2750.     - Deleting      Delete...
  2751.     10  Backspace   char left from cursor
  2752.     11  Delete      char right from cursor
  2753.     12  BkspcWord   word left from cursor
  2754.     13  DelWord     word right from cursor
  2755.     14  DeleteToSOL to start of line
  2756.     15  DeleteToEOL to end of line
  2757.     16  DeleteLine  whole line
  2758.     17  DelScreen   whole screen and refresh current line
  2759.  
  2760.     - History insert
  2761.     20  Back        Move one line back in history
  2762.     21  Forward     Move one line forward in history
  2763.     22  Beg         Move to first line in history
  2764.     23  End         Move to last line in history
  2765.     24  Complete    History retrieve like '!'
  2766.     25  Exec        Execute history line & bring up next
  2767.     26  Tail        Insert previous line except first word
  2768.     27  Bottom      Go below last history command
  2769.     28  DupWord     Duplicates the last word on this line
  2770.  
  2771.     - Completion
  2772.     30  Normal      Insert first matching file (or cycle)
  2773.     31  Partial     Insert common substring of all matching files
  2774.     32  All         Insert all matching files
  2775.     33  Directory   Find dir in quick cd list
  2776.     34  LastCD      Insert last current directory
  2777.     35  Show        Shows all matching files
  2778.  
  2779.     - Special
  2780.     40  Insert      Toggle Insert/Overwrite
  2781.     41  Quit        Silently perform 'quit'
  2782.     42  Help        Silently perform 'help'
  2783.     43  Refresh     Redraw current line
  2784.     44  Execute     Execute current line
  2785.     45  Leave       Edit new line, store this in hist
  2786.     46  EOF         Terminate shell
  2787.     47  NOP         Do nothing
  2788.     48  Echo^O      Echoes a ^O
  2789.     49  Beep        Echoes a ^G
  2790.  
  2791.     - Other
  2792.     50  Fkey        Execute command associated to last fkey
  2793.     51  Menu        Execute command associated to last menu
  2794.     52  Undo        Undoes last edit
  2795.     53  Repeat      Repeats last function
  2796.     54  SwapChar    Swaps the two chars left of cursor
  2797.  
  2798.  
  2799.     Command types
  2800.  
  2801.     0   +x      Editing function x, see above descriptions
  2802.     512 +x      Setmap x,     x=0..7
  2803.     1024+x      Insert key x, x=1..255
  2804.     1536+x      Macro x       x=1..15         (*)
  2805.     2048+x      String x      x=1..15         (*)
  2806.  
  2807.     Examples:
  2808.  
  2809.     keymap 0    66=49    # the  B key will beep
  2810.     keymap 0     2=16    # ^B key will erase line
  2811.     keymap 0  1122=35    # ESC-b will show matching files
  2812.     keymap 0 9=31 521=30 # Swaps TAB and SHIFT-TAB
  2813.  
  2814.